LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
PKCS9AtSequenceNumber.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_AT_SEQUENCE_NUMBER_H
17#define LIEF_PE_ATTRIBUTES_PKCS9_AT_SEQUENCE_NUMBER_H
18
19#include "LIEF/visibility.h"
21
22namespace LIEF {
23namespace PE {
24
25class Parser;
26class SignatureParser;
44
45 friend class Parser;
46 friend class SignatureParser;
47
48 public:
50 PKCS9AtSequenceNumber(uint32_t num) :
51 Attribute(Attribute::TYPE::PKCS9_AT_SEQUENCE_NUMBER),
52 number_{num}
53 {}
54
55 PKCS9AtSequenceNumber(const PKCS9AtSequenceNumber&) = default;
56 PKCS9AtSequenceNumber& operator=(const PKCS9AtSequenceNumber&) = default;
57
58 std::unique_ptr<Attribute> clone() const override {
59 return std::unique_ptr<Attribute>(new PKCS9AtSequenceNumber{*this});
60 }
61 uint32_t number() const {
64 return number_;
65 }
66 std::string print() const override;
69
70 static bool classof(const Attribute* attr) {
71 return attr->type() == Attribute::TYPE::PKCS9_AT_SEQUENCE_NUMBER;
72 }
73
74 void accept(Visitor& visitor) const override;
75
76 ~PKCS9AtSequenceNumber() override = default;
77
78 private:
79 uint32_t number_ = 0;
80};
81
82}
83}
84
85#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.25.4 (PKCS #9)
Definition PKCS9AtSequenceNumber.hpp:43
uint32_t number() const
Number as described in the RFC.
Definition PKCS9AtSequenceNumber.hpp:63
static bool classof(const Attribute *attr)
Definition PKCS9AtSequenceNumber.hpp:70
~PKCS9AtSequenceNumber() override=default
PKCS9AtSequenceNumber()=delete
PKCS9AtSequenceNumber(const PKCS9AtSequenceNumber &)=default
void accept(Visitor &visitor) const override
PKCS9AtSequenceNumber & operator=(const PKCS9AtSequenceNumber &)=default
PKCS9AtSequenceNumber(uint32_t num)
Definition PKCS9AtSequenceNumber.hpp:50
std::string print() const override
Print information about the attribute.
std::unique_ptr< Attribute > clone() const override
Definition PKCS9AtSequenceNumber.hpp:58
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
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41