LIEF: Library to Instrument Executable Formats Version 0.16.0
Loading...
Searching...
No Matches
PKCS9CounterSignature.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2024 R. Thomas
2 * Copyright 2017 - 2024 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_COUNTER_SIG_H
17#define LIEF_PE_ATTRIBUTES_PKCS9_COUNTER_SIG_H
18
19#include "LIEF/visibility.h"
22
23namespace LIEF {
24class VectorStream;
25namespace PE {
39
40 friend class Parser;
41 friend class SignatureParser;
42
43 public:
45 PKCS9CounterSignature(SignerInfo signer) :
46 Attribute(Attribute::TYPE::PKCS9_COUNTER_SIGNATURE),
47 signer_{std::move(signer)}
48 {}
49
50 PKCS9CounterSignature(const PKCS9CounterSignature&) = default;
51 PKCS9CounterSignature& operator=(const PKCS9CounterSignature&) = default;
52
53 std::unique_ptr<Attribute> clone() const override {
54 return std::unique_ptr<Attribute>(new PKCS9CounterSignature{*this});
55 }
56 const SignerInfo& signer() const {
59 return this->signer_;
60 }
61 std::string print() const override;
64
65 static bool classof(const Attribute* attr) {
66 return attr->type() == Attribute::TYPE::PKCS9_COUNTER_SIGNATURE;
67 }
68
69 void accept(Visitor& visitor) const override;
70
71 ~PKCS9CounterSignature() override = default;
72
73 private:
74 SignerInfo signer_;
75};
76
77}
78}
79
80#endif
Interface over PKCS #7 attribute.
Definition PE/signature/Attribute.hpp:29
virtual TYPE type() const
Concrete type of the attribute.
Definition PE/signature/Attribute.hpp:62
Interface over the structure described by the OID 1.2.840.113549.1.9.6 (PKCS #9)
Definition PKCS9CounterSignature.hpp:38
PKCS9CounterSignature(SignerInfo signer)
Definition PKCS9CounterSignature.hpp:45
static bool classof(const Attribute *attr)
Definition PKCS9CounterSignature.hpp:65
std::string print() const override
Print information about the attribute.
PKCS9CounterSignature()=delete
void accept(Visitor &visitor) const override
~PKCS9CounterSignature() override=default
std::unique_ptr< Attribute > clone() const override
Definition PKCS9CounterSignature.hpp:53
PKCS9CounterSignature(const PKCS9CounterSignature &)=default
const SignerInfo & signer() const
SignerInfo as described in the RFC #2985.
Definition PKCS9CounterSignature.hpp:58
PKCS9CounterSignature & operator=(const PKCS9CounterSignature &)=default
Definition VectorStream.hpp:29
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41