LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
LIEF::PE::SignerInfo Class Reference

#include <SignerInfo.hpp>

Inheritance diagram for LIEF::PE::SignerInfo:
Inheritance graph
[legend]
Collaboration diagram for LIEF::PE::SignerInfo:
Collaboration graph
[legend]

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 (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_t & encrypted_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
 
- Public Member Functions inherited from LIEF::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
 

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 Function Documentation

◆ accept()

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

Implements LIEF::Object.

◆ 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

◆ 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.

◆ 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

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