LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
LIEF::PE::SignerInfo Class Reference

#include <SignerInfo.hpp>

Inheritance diagram for LIEF::PE::SignerInfo:
Collaboration diagram for LIEF::PE::SignerInfo:

Public Types

using encrypted_digest_t = std::vector<uint8_t>
 
using attributes_t = std::vector<std::unique_ptr<Attribute>>
 Internal container used to store both authenticated and unauthenticated attributes.
 
using it_const_attributes_t = const_ref_iterator<const attributes_t&, const Attribute*>
 Iterator which outputs const Attribute&.
 
- Public Types inherited from LIEF::Object
template<class T >
using output_t = add_pointer_t<decay_t<T>>
 
template<class T >
using output_const_t = add_pointer_t<add_const_t<decay_t<T>>>
 

Public Member Functions

 SignerInfo ()
 
 SignerInfo (const SignerInfo &other)
 
SignerInfooperator= (SignerInfo other)
 
 SignerInfo (SignerInfo &&)
 
SignerInfooperator= (SignerInfo &&)
 
void swap (SignerInfo &other)
 
uint32_t version () const
 Should be 1.
 
span< const uint8_t > serial_number () const
 Return the serial number associated with the x509 certificate used by this signer.
 
const std::string & issuer () const
 Return the x509::issuer used by this signer.
 
ALGORITHMS digest_algorithm () const
 Algorithm (OID) used to hash the file.
 
ALGORITHMS encryption_algorithm () const
 Return the (public-key) algorithm used to encrypt the signature.
 
const encrypted_digest_tencrypted_digest () const
 Return the signature created by the signing certificate's private key.
 
it_const_attributes_t authenticated_attributes () const
 Iterator over LIEF::PE::Attribute for authenticated attributes.
 
it_const_attributes_t unauthenticated_attributes () const
 Iterator over LIEF::PE::Attribute for unauthenticated attributes.
 
const Attributeget_attribute (Attribute::TYPE type) const
 Return the authenticated or un-authenticated attribute matching the given PE::SIG_ATTRIBUTE_TYPES.
 
const Attributeget_auth_attribute (Attribute::TYPE type) const
 Return the authenticated attribute matching the given PE::SIG_ATTRIBUTE_TYPES.
 
const Attributeget_unauth_attribute (Attribute::TYPE type) const
 Return the un-authenticated attribute matching the given PE::SIG_ATTRIBUTE_TYPES.
 
const x509cert () const
 x509 certificate used by this signer. If it can't be found, it returns a nullptr
 
x509cert ()
 x509 certificate used by this signer. If it can't be found, it returns a nullptr
 
span< const uint8_t > raw_auth_data () const
 Raw blob that is signed by the signer certificate.
 
void accept (Visitor &visitor) const override
 
 ~SignerInfo () override
 
- Public Member Functions inherited from LIEF::Object
 Object ()
 
 Object (const Object &other)
 
Objectoperator= (const Object &other)
 
template<class T >
output_t< T > as ()
 
template<class T >
output_const_t< T > as () const
 
virtual bool operator== (const Object &other) const
 
virtual bool operator!= (const Object &other) const
 
virtual ~Object ()
 

Detailed Description

SignerInfo as described in the RFC 2315

SignerInfo ::= SEQUENCE {
version Version,
issuerAndSerialNumber IssuerAndSerialNumber,
digestAlgorithm DigestAlgorithmIdentifier,
authenticatedAttributes [0] IMPLICIT Attributes OPTIONAL,
digestEncryptionAlgorithm DigestEncryptionAlgorithmIdentifier,
encryptedDigest EncryptedDigest,
unauthenticatedAttributes [1] IMPLICIT Attributes OPTIONAL
}
EncryptedDigest ::= OCTET STRING

Member Typedef Documentation

◆ attributes_t

using LIEF::PE::SignerInfo::attributes_t = std::vector<std::unique_ptr<Attribute>>

Internal container used to store both authenticated and unauthenticated attributes.

◆ encrypted_digest_t

using LIEF::PE::SignerInfo::encrypted_digest_t = std::vector<uint8_t>

◆ it_const_attributes_t

Iterator which outputs const Attribute&.

Constructor & Destructor Documentation

◆ SignerInfo() [1/3]

LIEF::PE::SignerInfo::SignerInfo ( )

◆ SignerInfo() [2/3]

LIEF::PE::SignerInfo::SignerInfo ( const SignerInfo & other)

◆ SignerInfo() [3/3]

LIEF::PE::SignerInfo::SignerInfo ( SignerInfo && )

◆ ~SignerInfo()

LIEF::PE::SignerInfo::~SignerInfo ( )
override

Member Function Documentation

◆ accept()

void LIEF::PE::SignerInfo::accept ( Visitor & visitor) const
overridevirtual

Implements LIEF::Object.

◆ authenticated_attributes()

it_const_attributes_t LIEF::PE::SignerInfo::authenticated_attributes ( ) const
inline

Iterator over LIEF::PE::Attribute for authenticated attributes.

◆ cert() [1/2]

x509 * LIEF::PE::SignerInfo::cert ( )
inline

x509 certificate used by this signer. If it can't be found, it returns a nullptr

◆ cert() [2/2]

const x509 * LIEF::PE::SignerInfo::cert ( ) const
inline

x509 certificate used by this signer. If it can't be found, it returns a nullptr

◆ digest_algorithm()

ALGORITHMS LIEF::PE::SignerInfo::digest_algorithm ( ) const
inline

Algorithm (OID) used to hash the file.

This value should match LIEF::PE::ContentInfo::digest_algorithm and LIEF::PE::Signature::digest_algorithm

◆ encrypted_digest()

const encrypted_digest_t & LIEF::PE::SignerInfo::encrypted_digest ( ) const
inline

Return the signature created by the signing certificate's private key.

◆ encryption_algorithm()

ALGORITHMS LIEF::PE::SignerInfo::encryption_algorithm ( ) const
inline

Return the (public-key) algorithm used to encrypt the signature.

◆ get_attribute()

const Attribute * LIEF::PE::SignerInfo::get_attribute ( Attribute::TYPE type) const

Return the authenticated or un-authenticated attribute matching the given PE::SIG_ATTRIBUTE_TYPES.

It returns the first entry that matches the given type. If it can't be found, it returns a nullptr.

◆ get_auth_attribute()

const Attribute * LIEF::PE::SignerInfo::get_auth_attribute ( Attribute::TYPE type) const

Return the authenticated attribute matching the given PE::SIG_ATTRIBUTE_TYPES.

It returns the first entry that matches the given type. If it can't be found, it returns a nullptr.

◆ get_unauth_attribute()

const Attribute * LIEF::PE::SignerInfo::get_unauth_attribute ( Attribute::TYPE type) const

Return the un-authenticated attribute matching the given PE::SIG_ATTRIBUTE_TYPES.

It returns the first entry that matches the given type. If it can't be found, it returns a nullptr.

◆ issuer()

const std::string & LIEF::PE::SignerInfo::issuer ( ) const
inline

Return the x509::issuer used by this signer.

◆ operator=() [1/2]

SignerInfo & LIEF::PE::SignerInfo::operator= ( SignerInfo && )

◆ operator=() [2/2]

SignerInfo & LIEF::PE::SignerInfo::operator= ( SignerInfo other)

◆ raw_auth_data()

span< const uint8_t > LIEF::PE::SignerInfo::raw_auth_data ( ) const
inline

Raw blob that is signed by the signer certificate.

◆ serial_number()

span< const uint8_t > LIEF::PE::SignerInfo::serial_number ( ) const
inline

Return the serial number associated with the x509 certificate used by this signer.

See also
LIEF::PE::x509::serial_number SignerInfo::issuer

◆ swap()

void LIEF::PE::SignerInfo::swap ( SignerInfo & other)

◆ unauthenticated_attributes()

it_const_attributes_t LIEF::PE::SignerInfo::unauthenticated_attributes ( ) const
inline

Iterator over LIEF::PE::Attribute for unauthenticated attributes.

◆ version()

uint32_t LIEF::PE::SignerInfo::version ( ) const
inline

Should be 1.


The documentation for this class was generated from the following file: