Botan
2.1.0
Crypto and TLS for C++11
|
#include <x509_ext.h>
Public Member Functions | |
void | add (Certificate_Extension *extn, bool critical=false) |
void | contents_to (Data_Store &, Data_Store &) const |
void | decode_from (class BER_Decoder &) override |
void | encode_into (class DER_Encoder &) const override |
std::vector< std::pair< std::unique_ptr< Certificate_Extension >, bool > > | extensions () const |
Extensions (const Extensions &) | |
Extensions (bool st=true) | |
std::map< OID, std::pair< std::vector< uint8_t >, bool > > | extensions_raw () const |
std::unique_ptr< Certificate_Extension > | get (const OID &oid) const |
template<typename T > | |
std::unique_ptr< T > | get_raw (const OID &oid) |
Extensions & | operator= (const Extensions &) |
void | replace (Certificate_Extension *extn, bool critical=false) |
X.509 Certificate Extension List
Definition at line 86 of file x509_ext.h.
Botan::Extensions::Extensions | ( | const Extensions & | extensions | ) |
Definition at line 50 of file x509_ext.cpp.
References extensions().
|
inlineexplicit |
st | whether to throw an exception when encountering an unknown extension type during decoding |
Definition at line 165 of file x509_ext.h.
void Botan::Extensions::add | ( | Certificate_Extension * | extn, |
bool | critical = false |
||
) |
Adds a new extension to the list.
extn | the certificate extension |
critical | whether this extension should be marked as critical |
Invalid_Argument | if the extension is already present in the list |
Definition at line 91 of file x509_ext.cpp.
References Botan::Certificate_Extension::encode_inner(), Botan::Certificate_Extension::oid_name(), and Botan::Certificate_Extension::oid_of().
Referenced by Botan::X509::create_cert_req(), Botan::X509::create_self_signed_cert(), and Botan::CRL_Entry::encode_into().
void Botan::Extensions::contents_to | ( | Data_Store & | subject_info, |
Data_Store & | issuer_info | ||
) | const |
Definition at line 254 of file x509_ext.cpp.
References Botan::Data_Store::add().
Referenced by Botan::CRL_Entry::decode_from().
|
overridevirtual |
Decode whatever this object is from from
from | the BER_Decoder that will be read from |
Implements Botan::ASN1_Object.
Definition at line 205 of file x509_ext.cpp.
References Botan::OID::as_string(), Botan::BOOLEAN, Botan::BER_Decoder::decode(), Botan::BER_Decoder::decode_optional(), Botan::BER_Decoder::end_cons(), Botan::BER_Decoder::more_items(), Botan::OCTET_STRING, Botan::SEQUENCE, Botan::BER_Decoder::start_cons(), Botan::UNIVERSAL, and Botan::BER_Decoder::verify_end().
|
overridevirtual |
Encode whatever this object is into to
to | the DER_Encoder that will be written to |
Implements Botan::ASN1_Object.
Definition at line 157 of file x509_ext.cpp.
References Botan::DER_Encoder::encode(), Botan::Certificate_Extension::encode_inner(), Botan::DER_Encoder::encode_optional(), Botan::DER_Encoder::end_cons(), Botan::OCTET_STRING, Botan::Certificate_Extension::oid_of(), Botan::SEQUENCE, Botan::Certificate_Extension::should_encode(), and Botan::DER_Encoder::start_cons().
std::vector< std::pair< std::unique_ptr< Certificate_Extension >, bool > > Botan::Extensions::extensions | ( | ) | const |
Returns the list of extensions together with the corresponding criticality flag. Only contains the known extensions types declared in this header.
Definition at line 139 of file x509_ext.cpp.
Referenced by Botan::PKIX::check_chain(), and Extensions().
std::map< OID, std::pair< std::vector< uint8_t >, bool > > Botan::Extensions::extensions_raw | ( | ) | const |
Returns the list of extensions as raw, encoded bytes together with the corresponding criticality flag. Contains all extensions, known as well as unknown extensions.
Definition at line 149 of file x509_ext.cpp.
std::unique_ptr< Certificate_Extension > Botan::Extensions::get | ( | const OID & | oid | ) | const |
Searches for an extension by OID and returns the result. Only the known extensions types declared in this header are searched for by this function.
Definition at line 126 of file x509_ext.cpp.
Referenced by Botan::PKCS10_Request::constraints(), Botan::PKCS10_Request::ex_constraints(), Botan::PKCS10_Request::is_CA(), and Botan::PKCS10_Request::path_limit().
|
inline |
Searches for an extension by OID and returns the result. Only the unknown extensions, that is, extensions types that are not declared in this header, are searched for by this function.
Definition at line 124 of file x509_ext.h.
References Botan::OID::as_string().
Extensions & Botan::Extensions::operator= | ( | const Extensions & | other | ) |
Definition at line 58 of file x509_ext.cpp.
void Botan::Extensions::replace | ( | Certificate_Extension * | extn, |
bool | critical = false |
||
) |
Adds an extension to the list or replaces it.
extn | the certificate extension |
critical | whether this extension should be marked as critical |
Definition at line 111 of file x509_ext.cpp.
References Botan::Certificate_Extension::encode_inner(), and Botan::Certificate_Extension::oid_of().
Referenced by Botan::X509_CA::sign_request().