LIEF: Library to Instrument Executable Formats
Version 1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
lief-install
x86_64
static
include
LIEF
BinaryStream
ASN1Reader.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_ASN1_READER_H
17
#define LIEF_ASN1_READER_H
18
19
#include <vector>
20
#include <memory>
21
#include <cstdint>
22
#include <string>
23
24
#include "
LIEF/errors.hpp
"
25
26
struct
mbedtls_x509_crt;
27
struct
mbedtls_x509_time;
28
29
namespace
LIEF
{
30
class
BinaryStream
;
31
32
class
ASN1Reader
{
33
public
:
34
ASN1Reader
() =
delete
;
35
36
ASN1Reader
(
BinaryStream
& stream) :
37
stream_(stream)
38
{}
39
40
ASN1Reader
(
const
ASN1Reader
&) =
delete
;
41
ASN1Reader
&
operator=
(
const
ASN1Reader
&) =
delete
;
42
43
44
result<bool>
is_tag
(
int
tag);
45
46
result<size_t>
read_tag
(
int
tag);
47
result<size_t>
read_len
();
48
result<std::string>
read_alg
();
49
result<std::string>
read_oid
();
50
result<bool>
read_bool
();
51
result<int32_t>
read_int
();
52
result<int64_t>
read_int64
();
53
result<std::vector<uint8_t>
>
read_large_int
();
54
55
result<std::vector<uint8_t>
>
read_bitstring
();
56
result<std::vector<uint8_t>
>
read_octet_string
();
57
result<std::string>
read_utf8_string
();
58
result<std::unique_ptr<mbedtls_x509_crt>
>
read_cert
();
59
result<std::string>
x509_read_names
();
60
result<std::vector<uint8_t>
>
x509_read_serial
();
61
result<std::unique_ptr<mbedtls_x509_time>
>
x509_read_time
();
62
63
std::string
get_str_tag
();
64
65
static
std::string
tag2str
(
int
tag);
66
67
private
:
68
BinaryStream
& stream_;
69
};
70
71
}
72
#endif
LIEF::ASN1Reader::read_cert
result< std::unique_ptr< mbedtls_x509_crt > > read_cert()
LIEF::ASN1Reader::read_oid
result< std::string > read_oid()
LIEF::ASN1Reader::read_large_int
result< std::vector< uint8_t > > read_large_int()
LIEF::ASN1Reader::tag2str
static std::string tag2str(int tag)
LIEF::ASN1Reader::read_int
result< int32_t > read_int()
LIEF::ASN1Reader::is_tag
result< bool > is_tag(int tag)
LIEF::ASN1Reader::ASN1Reader
ASN1Reader()=delete
LIEF::ASN1Reader::operator=
ASN1Reader & operator=(const ASN1Reader &)=delete
LIEF::ASN1Reader::x509_read_time
result< std::unique_ptr< mbedtls_x509_time > > x509_read_time()
LIEF::ASN1Reader::read_utf8_string
result< std::string > read_utf8_string()
LIEF::ASN1Reader::read_bitstring
result< std::vector< uint8_t > > read_bitstring()
LIEF::ASN1Reader::ASN1Reader
ASN1Reader(const ASN1Reader &)=delete
LIEF::ASN1Reader::read_int64
result< int64_t > read_int64()
LIEF::ASN1Reader::read_octet_string
result< std::vector< uint8_t > > read_octet_string()
LIEF::ASN1Reader::read_len
result< size_t > read_len()
LIEF::ASN1Reader::read_alg
result< std::string > read_alg()
LIEF::ASN1Reader::x509_read_serial
result< std::vector< uint8_t > > x509_read_serial()
LIEF::ASN1Reader::read_tag
result< size_t > read_tag(int tag)
LIEF::ASN1Reader::ASN1Reader
ASN1Reader(BinaryStream &stream)
Definition
ASN1Reader.hpp:36
LIEF::ASN1Reader::x509_read_names
result< std::string > x509_read_names()
LIEF::ASN1Reader::get_str_tag
std::string get_str_tag()
LIEF::ASN1Reader::read_bool
result< bool > read_bool()
LIEF::BinaryStream
Class that is used to a read stream of data from different sources.
Definition
BinaryStream.hpp:33
LIEF::result
Wrapper that contains an Object (T) or an error.
Definition
errors.hpp:75
errors.hpp
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:40
Generated by
1.17.0