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

#include <ContentInfo.hpp>

Inheritance diagram for LIEF::PE::ContentInfo:
Collaboration diagram for LIEF::PE::ContentInfo:

Classes

class  Content
 

Public Member Functions

 ContentInfo ()
 
 ContentInfo (const ContentInfo &other)
 
 ContentInfo (ContentInfo &&other) noexcept=default
 
ContentInfooperator= (ContentInfo other)
 
void swap (ContentInfo &other) noexcept
 
oid_t content_type () const
 Return the OID that describes the content wrapped by this object. It should match SPC_INDIRECT_DATA_OBJID (1.3.6.1.4.1.311.2.1.4)
 
Contentvalue ()
 
const Contentvalue () const
 
std::vector< uint8_t > digest () const
 Return the digest (authentihash) if the underlying content type is SPC_INDIRECT_DATA_OBJID Otherwise, return an empty vector.
 
ALGORITHMS digest_algorithm () const
 Return the digest used to hash the file.
 
void accept (Visitor &visitor) const override
 
 ~ContentInfo () override=default
 
- 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 ()
 

Additional Inherited Members

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

Detailed Description

ContentInfo as described in the RFC2315 (https://tools.ietf.org/html/rfc2315#section-7)

ContentInfo ::= SEQUENCE {
contentType ContentType,
content [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL
}
ContentType ::= OBJECT IDENTIFIER

In the case of PE signature, ContentType must be set to SPC_INDIRECT_DATA_OBJID OID: 1.3.6.1.4.1.311.2.1.4 and content is defined by the structure: SpcIndirectDataContent

SpcIndirectDataContent ::= SEQUENCE {
data SpcAttributeTypeAndOptionalValue,
messageDigest DigestInfo
}
SpcAttributeTypeAndOptionalValue ::= SEQUENCE {
type ObjectID,
value [0] EXPLICIT ANY OPTIONAL
}

For PE signature, SpcAttributeTypeAndOptionalValue.type is set to SPC_PE_IMAGE_DATAOBJ (OID: 1.3.6.1.4.1.311.2.1.15) and the value is defined by SpcPeImageData

DigestInfo ::= SEQUENCE {
digestAlgorithm AlgorithmIdentifier,
digest OCTETSTRING
}
AlgorithmIdentifier ::= SEQUENCE {
algorithm ObjectID,
parameters [0] EXPLICIT ANY OPTIONAL
}

Constructor & Destructor Documentation

◆ ContentInfo() [1/3]

LIEF::PE::ContentInfo::ContentInfo ( )

◆ ContentInfo() [2/3]

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

◆ ContentInfo() [3/3]

LIEF::PE::ContentInfo::ContentInfo ( ContentInfo && other)
defaultnoexcept

◆ ~ContentInfo()

LIEF::PE::ContentInfo::~ContentInfo ( )
overridedefault

Member Function Documentation

◆ accept()

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

Implements LIEF::Object.

◆ content_type()

oid_t LIEF::PE::ContentInfo::content_type ( ) const
inline

Return the OID that describes the content wrapped by this object. It should match SPC_INDIRECT_DATA_OBJID (1.3.6.1.4.1.311.2.1.4)

◆ digest()

std::vector< uint8_t > LIEF::PE::ContentInfo::digest ( ) const

Return the digest (authentihash) if the underlying content type is SPC_INDIRECT_DATA_OBJID Otherwise, return an empty vector.

◆ digest_algorithm()

ALGORITHMS LIEF::PE::ContentInfo::digest_algorithm ( ) const

Return the digest used to hash the file.

◆ operator=()

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

◆ swap()

void LIEF::PE::ContentInfo::swap ( ContentInfo & other)
noexcept

◆ value() [1/2]

Content & LIEF::PE::ContentInfo::value ( )
inline

◆ value() [2/2]

const Content & LIEF::PE::ContentInfo::value ( ) const
inline

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