scclib
Stable Cloud Computing C++ Library
|
PEM formatted DER document. More...
#include <der.h>
Public Member Functions | |
PemDocument (unsigned chars_per_line=64) | |
PemDocument (const std::string &label, unsigned chars_per_line=64) | |
unsigned | chars_per_line () const |
void | chars_per_line (unsigned v) |
std::string | label () const |
void | label (std::string v) |
virtual void | parse (std::istream &) |
Parse document from an input stream. More... | |
virtual void | parse (const std::vector< char > &) |
Parse a PEM-formatted buffer. | |
virtual void | dump (std::vector< char > &) |
PEM-formatted dump to a buffer. More... | |
virtual void | dump (std::ostream &) |
Dump to output stream. More... | |
![]() | |
DerDocument (const DerDocument &)=delete | |
DerDocument & | operator= (const DerDocument &)=delete |
DerDocument (DerDocument &&b) | |
DerDocument & | operator= (DerDocument &&b) |
bool | equal (const DerDocument &) const |
Compare binary data. | |
void | dump_bin (std::vector< char > &v) const |
Dump the binary vector. | |
std::string | str (bool=false) const |
Debug string dump. More... | |
DerBase & | root () |
Root DerBase. More... | |
BasePtr | root_ptr () const |
Return the root pointer. More... | |
void | clear () |
Clear the document. | |
Additional Inherited Members | |
![]() | |
static BasePtr | parse_element (const std::vector< uint8_t > &, size_t=0) |
Parse an element from a data vector. More... | |
static BasePtr | parse_element (const std::vector< char > &v, size_t idx=0) |
static void | dump_element (const BasePtr &, std::vector< uint8_t > &) |
Dump an element to a data vector. More... | |
static void | dump_element (const BasePtr &b, std::vector< char > &v) |
static std::string | print_element (const BasePtr &, bool=false, const std::string &=" |") |
Print an element and any sub-elements to a string. More... | |
![]() | |
void | parse_bin () |
void | dump_bin () |
![]() | |
SecVecUchar | m_bin |
PEM formatted DER document.
Base64 encoded format defined in https://tools.ietf.org/html/rfc1421
|
virtual |
Dump to output stream.
Throws exception on dump or write error.
Reimplemented from scc::crypto::DerDocument.
|
virtual |
PEM-formatted dump to a buffer.
Data is appended to the buffer, starting with --—BEGIN <label>--— line, and ending with --—END <label>--— line.
Writes chars per line for the output base64 data.
Exception on error, or if label is empty.
Reimplemented from scc::crypto::DerDocument.
|
virtual |
Parse document from an input stream.
Scans the input stream until "-----BEGIN <label>-----" line is found. Continues until "-----END <label>-----" line is found. Decodes base64-encoded DER data.
Throws exception on parse error, or if BEGIN/END block not found.
Reimplemented from scc::crypto::DerDocument.