Go to the documentation of this file.
16#ifndef LIEF_PE_CONTENT_INFO_H
17#define LIEF_PE_CONTENT_INFO_H
80 friend class SignatureParser;
83 class Content :
public Object {
93 virtual std::unique_ptr<Content>
clone()
const = 0;
94 virtual void print(std::ostream& os)
const = 0;
103 static_assert(std::is_base_of<Content, T>::value,
104 "Require ContentInfo inheritance");
105 if (T::classof(
this)) {
106 return static_cast<const T*
>(
this);
113 return const_cast<T*
>(
static_cast<const Content*
>(
this)->cast<T>());
125 void swap(ContentInfo& other)
noexcept;
130 return value_->content_type();
140 std::vector<uint8_t>
digest()
const;
148 void accept(Visitor& visitor)
const override;
155 std::unique_ptr<Content> value_;
~Content() override=default
const oid_t & content_type() const
Definition ContentInfo.hpp:89
Content(oid_t oid)
Definition ContentInfo.hpp:85
virtual std::unique_ptr< Content > clone() const =0
virtual void print(std::ostream &os) const =0
T * cast()
Definition ContentInfo.hpp:112
const T * cast() const
Definition ContentInfo.hpp:102
friend std::ostream & operator<<(std::ostream &os, const Content &content)
Definition ContentInfo.hpp:96
Definition ContentInfo.hpp:78
std::vector< uint8_t > digest() const
Return the digest (authentihash) if the underlying content type is SPC_INDIRECT_DATA_OBJID Otherwise,...
ALGORITHMS digest_algorithm() const
Return the digest used to hash the file.
void accept(Visitor &visitor) const override
ContentInfo(ContentInfo &&other) noexcept=default
ContentInfo(const ContentInfo &other)
const Content & value() const
Definition ContentInfo.hpp:137
oid_t content_type() const
Return the OID that describes the content wrapped by this object. It should match SPC_INDIRECT_DATA_O...
Definition ContentInfo.hpp:129
~ContentInfo() override=default
Content & value()
Definition ContentInfo.hpp:133
void swap(ContentInfo &other) noexcept
ContentInfo & operator=(ContentInfo other)
friend std::ostream & operator<<(std::ostream &os, const ContentInfo &content_info)
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
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
ALGORITHMS
Cryptography algorithms.
Definition PE/enums.hpp:686
std::string oid_t
Definition PE/signature/types.hpp:23
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41