LIEF: Library to Instrument Executable Formats
Version 0.17.4
Toggle main menu visibility
Loading...
Searching...
No Matches
install
linux
x86_64
sdk
static
include
LIEF
PE
signature
attributes
PKCS9MessageDigest.hpp
Go to the documentation of this file.
1
/* Copyright 2017 - 2025 R. Thomas
2
* Copyright 2017 - 2025 Quarkslab
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
#ifndef LIEF_PE_ATTRIBUTES_PKCS9_MESSAGE_DIGEST_H
17
#define LIEF_PE_ATTRIBUTES_PKCS9_MESSAGE_DIGEST_H
18
19
#include "
LIEF/visibility.h
"
20
#include "
LIEF/PE/signature/Attribute.hpp
"
21
#include "
LIEF/span.hpp
"
22
23
#include <vector>
24
25
namespace
LIEF
{
26
namespace
PE
{
27
28
class
Parser
;
29
class
SignatureParser
;
30
46
class
LIEF_API
PKCS9MessageDigest
:
public
Attribute
{
47
48
friend
class
Parser
;
49
friend
class
SignatureParser
;
50
51
public
:
52
PKCS9MessageDigest
() =
delete
;
53
PKCS9MessageDigest
(std::vector<uint8_t>
digest
) :
54
Attribute
(
Attribute
::
TYPE
::PKCS9_MESSAGE_DIGEST),
55
digest_{std::move(
digest
)}
56
{}
57
58
PKCS9MessageDigest
(
const
PKCS9MessageDigest
&) =
default
;
59
PKCS9MessageDigest
&
operator=
(
const
PKCS9MessageDigest
&) =
default
;
60
61
std::unique_ptr<Attribute>
clone
()
const override
{
62
return
std::unique_ptr<Attribute>(
new
PKCS9MessageDigest
{*
this
});
63
}
64
66
span<const uint8_t>
digest
()
const
{
67
return
digest_;
68
}
69
71
std::string
print
()
const override
;
72
73
static
bool
classof
(
const
Attribute
* attr) {
74
return
attr->
type
() ==
Attribute::TYPE::PKCS9_MESSAGE_DIGEST
;
75
}
76
77
void
accept
(
Visitor
& visitor)
const override
;
78
79
~PKCS9MessageDigest
()
override
=
default
;
80
81
private
:
82
std::vector<uint8_t> digest_;
83
};
84
85
}
86
}
87
88
#endif
Attribute.hpp
LIEF::PE::Attribute::TYPE
TYPE
Definition
PE/signature/Attribute.hpp:35
LIEF::PE::Attribute::TYPE::PKCS9_MESSAGE_DIGEST
@ PKCS9_MESSAGE_DIGEST
Definition
PE/signature/Attribute.hpp:51
LIEF::PE::Attribute::Attribute
Attribute()=delete
LIEF::PE::Attribute::type
virtual TYPE type() const
Concrete type of the attribute.
Definition
PE/signature/Attribute.hpp:62
LIEF::PE::PKCS9MessageDigest::PKCS9MessageDigest
PKCS9MessageDigest(std::vector< uint8_t > digest)
Definition
PKCS9MessageDigest.hpp:53
LIEF::PE::PKCS9MessageDigest::print
std::string print() const override
Print information about the attribute.
LIEF::PE::PKCS9MessageDigest::PKCS9MessageDigest
PKCS9MessageDigest()=delete
LIEF::PE::PKCS9MessageDigest::accept
void accept(Visitor &visitor) const override
LIEF::PE::PKCS9MessageDigest::PKCS9MessageDigest
PKCS9MessageDigest(const PKCS9MessageDigest &)=default
LIEF::PE::PKCS9MessageDigest::SignatureParser
friend class SignatureParser
Definition
PKCS9MessageDigest.hpp:49
LIEF::PE::PKCS9MessageDigest::~PKCS9MessageDigest
~PKCS9MessageDigest() override=default
LIEF::PE::PKCS9MessageDigest::operator=
PKCS9MessageDigest & operator=(const PKCS9MessageDigest &)=default
LIEF::PE::PKCS9MessageDigest::Parser
friend class Parser
Definition
PKCS9MessageDigest.hpp:48
LIEF::PE::PKCS9MessageDigest::digest
span< const uint8_t > digest() const
Message digeset as a blob of bytes as described in the RFC.
Definition
PKCS9MessageDigest.hpp:66
LIEF::PE::PKCS9MessageDigest::clone
std::unique_ptr< Attribute > clone() const override
Definition
PKCS9MessageDigest.hpp:61
LIEF::PE::PKCS9MessageDigest::classof
static bool classof(const Attribute *attr)
Definition
PKCS9MessageDigest.hpp:73
LIEF::PE::Parser
Main interface to parse PE binaries. In particular the static functions: Parser::parse should be used...
Definition
PE/Parser.hpp:52
LIEF::PE::SignatureParser
Definition
SignatureParser.hpp:37
LIEF::Visitor
Definition
Visitor.hpp:210
LIEF::PE
Namespace related to the LIEF's PE module.
Definition
Abstract/Header.hpp:32
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:40
LIEF::span
tcb::span< ElementType, Extent > span
Definition
span.hpp:22
span.hpp
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:41
Generated by
1.17.0