LIEF: Library to Instrument Executable Formats Version 0.17.0
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
16#ifndef LIEF_PE_SIGNER_INFO_H
17#define LIEF_PE_SIGNER_INFO_H
56 friend class SignatureParser;
57 friend class Signature;
60 using encrypted_digest_t = std::vector<uint8_t>;
61 using attributes_t = std::vector<std::unique_ptr<Attribute>>;
65 using it_const_attributes_t = const_ref_iterator<const attributes_t&, const Attribute*>;
77 void swap(SignerInfo& other);
93 const std::string&
issuer()
const {
104 return digest_algorithm_;
110 return digest_enc_algorithm_;
116 return encrypted_digest_;
121 return authenticated_attributes_;
126 return unauthenticated_attributes_;
147 const x509*
cert()
const {
160 return raw_auth_data_;
163 void accept(Visitor& visitor)
const override;
170 uint32_t version_ = 0;
172 std::vector<uint8_t> serialno_;
174 ALGORITHMS digest_algorithm_ = ALGORITHMS::UNKNOWN;
175 ALGORITHMS digest_enc_algorithm_ = ALGORITHMS::UNKNOWN;
177 encrypted_digest_t encrypted_digest_;
179 std::vector<uint8_t> raw_auth_data_;
181 attributes_t authenticated_attributes_;
182 attributes_t unauthenticated_attributes_;
184 std::unique_ptr<x509> cert_;
Interface over PKCS #7 attribute.
Definition PE/signature/Attribute.hpp:29
Main interface to parse PE binaries. In particular the static functions: Parser::parse should be used...
Definition PE/Parser.hpp:47
Definition SignatureParser.hpp:37
Main interface for the PKCS #7 signature scheme.
Definition Signature.hpp:39
Definition SignerInfo.hpp:54
const Attribute * get_attribute(Attribute::TYPE type) const
Return the authenticated or un-authenticated attribute matching the given PE::SIG_ATTRIBUTE_TYPES.
const Attribute * get_auth_attribute(Attribute::TYPE type) const
Return the authenticated attribute matching the given PE::SIG_ATTRIBUTE_TYPES.
SignerInfo & operator=(SignerInfo other)
const Attribute * get_unauth_attribute(Attribute::TYPE type) const
Return the un-authenticated attribute matching the given PE::SIG_ATTRIBUTE_TYPES.
it_const_attributes_t unauthenticated_attributes() const
Iterator over LIEF::PE::Attribute for unauthenticated attributes.
Definition SignerInfo.hpp:125
SignerInfo(const SignerInfo &other)
void accept(Visitor &visitor) const override
const x509 * cert() const
x509 certificate used by this signer. If it can't be found, it returns a nullptr
Definition SignerInfo.hpp:149
span< const uint8_t > raw_auth_data() const
Raw blob that is signed by the signer certificate.
Definition SignerInfo.hpp:159
void swap(SignerInfo &other)
span< const uint8_t > serial_number() const
Return the serial number associated with the x509 certificate used by this signer.
Definition SignerInfo.hpp:90
friend std::ostream & operator<<(std::ostream &os, const SignerInfo &signer_info)
SignerInfo & operator=(SignerInfo &&)
const std::string & issuer() const
Return the x509::issuer used by this signer.
Definition SignerInfo.hpp:95
it_const_attributes_t authenticated_attributes() const
Iterator over LIEF::PE::Attribute for authenticated attributes.
Definition SignerInfo.hpp:120
const encrypted_digest_t & encrypted_digest() const
Return the signature created by the signing certificate's private key.
Definition SignerInfo.hpp:115
uint32_t version() const
Should be 1.
Definition SignerInfo.hpp:80
ALGORITHMS digest_algorithm() const
Algorithm (OID) used to hash the file.
Definition SignerInfo.hpp:103
ALGORITHMS encryption_algorithm() const
Return the (public-key) algorithm used to encrypt the signature.
Definition SignerInfo.hpp:109
x509 * cert()
x509 certificate used by this signer. If it can't be found, it returns a nullptr
Definition SignerInfo.hpp:154
SignerInfo(SignerInfo &&)
Interface over a x509 certificate.
Definition x509.hpp:43
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
ALGORITHMS
Cryptography algorithms.
Definition PE/enums.hpp:686
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41