7#ifndef BOTAN_ASN1_PRINT_H_
8#define BOTAN_ASN1_PRINT_H_
10#include <botan/asn1_obj.h>
33 m_print_context_specific(print_context_specific), m_max_depth(max_depth) {}
35 void print_to_stream(std::ostream& out,
const uint8_t in[],
size_t len)
const;
37 std::string print(
const uint8_t in[],
size_t len)
const;
39 template <
typename Alloc>
40 std::string
print(
const std::vector<uint8_t, Alloc>& vec)
const {
41 return print(vec.data(), vec.size());
49 ASN1_Type type_tag,
ASN1_Class class_tag,
size_t level,
size_t length, std::string_view value)
const = 0;
58 const std::vector<uint8_t>& vec)
const = 0;
66 void decode(std::ostream& output,
BER_Decoder& decoder,
size_t level)
const;
68 const bool m_print_context_specific;
69 const size_t m_max_depth;
88 size_t print_binary_limit = 2048,
89 bool print_context_specific =
true,
90 size_t initial_level = 0,
91 size_t value_column = 60,
92 size_t max_depth = 64) :
94 m_print_limit(print_limit),
95 m_print_binary_limit(print_binary_limit),
96 m_initial_level(initial_level),
97 m_value_column(value_column) {}
101 ASN1_Type type_tag,
ASN1_Class class_tag,
size_t level,
size_t length, std::string_view value)
const override;
103 std::string format_bin(
ASN1_Type type_tag,
ASN1_Class class_tag,
const std::vector<uint8_t>& vec)
const override;
105 std::string format_bn(
const BigInt& bn)
const override;
107 const size_t m_print_limit;
108 const size_t m_print_binary_limit;
109 const size_t m_initial_level;
110 const size_t m_value_column;
ASN1_Pretty_Printer(size_t print_limit=4096, size_t print_binary_limit=2048, bool print_context_specific=true, size_t initial_level=0, size_t value_column=60, size_t max_depth=64)
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)