Botan  2.4.0
Crypto and TLS for C++11
Public Member Functions | List of all members
Botan::ASN1_Pretty_Printer Class Referencefinal

#include <asn1_print.h>

Inheritance diagram for Botan::ASN1_Pretty_Printer:

Public Member Functions

 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)
std::string print (const uint8_t in[], size_t len) const
template<typename Alloc >
std::string print (const std::vector< uint8_t, Alloc > &vec) const
void print_to_stream (std::ostream &out, const uint8_t in[], size_t len) const

Detailed Description

Format ASN.1 data into human readable output. The exact form of the output for any particular input is not guaranteed and may change from release to release.

Definition at line 77 of file asn1_print.h.

Constructor & Destructor Documentation

◆ ASN1_Pretty_Printer()

Botan::ASN1_Pretty_Printer::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 
print_limitstrings larger than this are not printed
print_binary_limitbinary strings larger than this are not printed
print_context_specificif true, try to parse nested context specific data.
initial_levelthe initial depth (0 or 1 are the only reasonable values)
value_columnASN.1 values are lined up at this column in output

Definition at line 87 of file asn1_print.h.

91  :
92  ASN1_Formatter(print_context_specific),
93  m_print_limit(print_limit),
94  m_print_binary_limit(print_binary_limit),
95  m_initial_level(initial_level),
96  m_value_column(value_column)
97  {}
ASN1_Formatter(bool print_context_specific)
Definition: asn1_print.h:30

Member Function Documentation

◆ print() [1/2]

std::string Botan::ASN1_Formatter::print ( const uint8_t  in[],
size_t  len 
) const

Definition at line 59 of file asn1_print.cpp.

References Botan::ASN1_Formatter::print_to_stream().

60  {
61  std::ostringstream output;
62  print_to_stream(output, in, len);
63  return output.str();
64  }
void print_to_stream(std::ostream &out, const uint8_t in[], size_t len) const
Definition: asn1_print.cpp:66

◆ print() [2/2]

template<typename Alloc >
std::string Botan::ASN1_Formatter::print ( const std::vector< uint8_t, Alloc > &  vec) const

Definition at line 41 of file asn1_print.h.

References Botan::PEM_Code::decode().

42  {
43  return print(, vec.size());
44  }
std::string print(const uint8_t in[], size_t len) const
Definition: asn1_print.cpp:59

◆ print_to_stream()

void Botan::ASN1_Formatter::print_to_stream ( std::ostream &  out,
const uint8_t  in[],
size_t  len 
) const

The documentation for this class was generated from the following files: