LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
PKCS9SigningTime.hpp
Go to the documentation of this file.
1
2/* Copyright 2017 - 2024 R. Thomas
3 * Copyright 2017 - 2024 Quarkslab
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17#ifndef LIEF_PE_ATTRIBUTES_PKCS9_SIGNING_TIME_H
18#define LIEF_PE_ATTRIBUTES_PKCS9_SIGNING_TIME_H
19#include <array>
20
21#include "LIEF/visibility.h"
23
24namespace LIEF {
25namespace PE {
26class LIEF_API PKCS9SigningTime : public Attribute {
43
44 friend class Parser;
45 friend class SignatureParser;
46
47 public: using time_t = std::array<int32_t, 6>;
50
51 PKCS9SigningTime() = delete;
52 PKCS9SigningTime(time_t time) :
53 Attribute(Attribute::TYPE::PKCS9_SIGNING_TIME),
54 time_{time}
55 {}
56
57 PKCS9SigningTime(const PKCS9SigningTime&) = default;
58 PKCS9SigningTime& operator=(const PKCS9SigningTime&) = default;
59 const time_t& time() const {
62 return time_;
63 }
64 std::string print() const override;
67
68 std::unique_ptr<Attribute> clone() const override {
69 return std::unique_ptr<Attribute>(new PKCS9SigningTime{*this});
70 }
71
72 static bool classof(const Attribute* attr) {
73 return attr->type() == Attribute::TYPE::PKCS9_SIGNING_TIME;
74 }
75
76 void accept(Visitor& visitor) const override;
77
78 ~PKCS9SigningTime() override = default;
79
80 private:
81 time_t time_;
82};
83
84}
85}
86
87#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.5 (PKCS #9)
Definition PKCS9SigningTime.hpp:42
~PKCS9SigningTime() override=default
std::unique_ptr< Attribute > clone() const override
Definition PKCS9SigningTime.hpp:68
PKCS9SigningTime(const PKCS9SigningTime &)=default
static bool classof(const Attribute *attr)
Definition PKCS9SigningTime.hpp:72
void accept(Visitor &visitor) const override
PKCS9SigningTime & operator=(const PKCS9SigningTime &)=default
PKCS9SigningTime(time_t time)
Definition PKCS9SigningTime.hpp:52
std::string print() const override
Print information about the attribute.
const time_t & time() const
Time as an array [year, month, day, hour, min, sec].
Definition PKCS9SigningTime.hpp:61
PKCS9SigningTime()=delete
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