LIEF: Library to Instrument Executable Formats Version 1.0.0
Loading...
Searching...
No Matches
PKCS9MessageDigest.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2026 R. Thomas
2 * Copyright 2017 - 2026 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"
21#include "LIEF/span.hpp"
22
23#include <vector>
24
25namespace LIEF {
26namespace PE {
27
28class Parser;
29class SignatureParser;
30
49
50 friend class Parser;
51 friend class SignatureParser;
52
53 public:
55 PKCS9MessageDigest(std::vector<uint8_t> digest) :
56 Attribute(Attribute::TYPE::PKCS9_MESSAGE_DIGEST),
57 digest_{std::move(digest)} {}
58
61
62 std::unique_ptr<Attribute> clone() const override {
63 return std::unique_ptr<Attribute>(new PKCS9MessageDigest{*this});
64 }
65
68 return digest_;
69 }
70
72 std::string print() const override;
73
74 static bool classof(const Attribute* attr) {
76 }
77
78 void accept(Visitor& visitor) const override;
79
80 ~PKCS9MessageDigest() override = default;
81
82 private:
83 std::vector<uint8_t> digest_;
84};
85
86}
87}
88
89#endif
TYPE
Definition PE/signature/Attribute.hpp:35
@ PKCS9_MESSAGE_DIGEST
Definition PE/signature/Attribute.hpp:51
virtual TYPE type() const
Concrete type of the attribute.
Definition PE/signature/Attribute.hpp:62
PKCS9MessageDigest(std::vector< uint8_t > digest)
Definition PKCS9MessageDigest.hpp:55
std::string print() const override
Print information about the attribute.
void accept(Visitor &visitor) const override
PKCS9MessageDigest(const PKCS9MessageDigest &)=default
friend class SignatureParser
Definition PKCS9MessageDigest.hpp:51
~PKCS9MessageDigest() override=default
PKCS9MessageDigest & operator=(const PKCS9MessageDigest &)=default
friend class Parser
Definition PKCS9MessageDigest.hpp:50
span< const uint8_t > digest() const
Message digeset as a blob of bytes as described in the RFC.
Definition PKCS9MessageDigest.hpp:67
std::unique_ptr< Attribute > clone() const override
Definition PKCS9MessageDigest.hpp:62
static bool classof(const Attribute *attr)
Definition PKCS9MessageDigest.hpp:74
Main interface to parse PE binaries. In particular, the static Parser::parse functions should be used...
Definition PE/Parser.hpp:52
Definition SignatureParser.hpp:37
Definition Visitor.hpp:212
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
LIEF namespace.
Definition Abstract/Binary.hpp:40
tcb::span< ElementType, Extent > span
Definition span.hpp:22
#define LIEF_API
Definition visibility.h:43