|
Botan 3.12.0
Crypto and TLS for C&
|
#include <pkix_types.h>
Public Member Functions | |
| void | add (std::unique_ptr< Certificate_Extension > extn, bool critical=false) |
| bool | add_new (std::unique_ptr< Certificate_Extension > extn, bool critical=false) |
| std::vector< uint8_t > | BER_encode () const |
| bool | critical_extension_set (const OID &oid) const |
| std::vector< OID > | critical_extensions () const |
| void | decode_from (BER_Decoder &from) override |
| void | encode_into (DER_Encoder &to) const override |
| bool | extension_set (const OID &oid) const |
| Extensions ()=default | |
| Extensions (const Extensions &)=default | |
| Extensions (Extensions &&)=default | |
| std::vector< std::pair< std::unique_ptr< Certificate_Extension >, bool > > | extensions () const |
| std::map< OID, std::pair< std::vector< uint8_t >, bool > > | extensions_raw () const |
| std::unique_ptr< Certificate_Extension > | get (const OID &oid) const |
| std::vector< uint8_t > | get_extension_bits (const OID &oid) const |
| const Certificate_Extension * | get_extension_object (const OID &oid) const |
| template<typename T> | |
| const T * | get_extension_object_as (const OID &oid=T::static_oid()) const |
| const std::vector< OID > & | get_extension_oids () const |
| template<typename T> | |
| std::unique_ptr< T > | get_raw (const OID &oid) const |
| Extensions & | operator= (const Extensions &)=default |
| Extensions & | operator= (Extensions &&)=default |
| bool | remove (const OID &oid) |
| void | replace (std::unique_ptr< Certificate_Extension > extn, bool critical=false) |
| ~Extensions () override=default | |
X.509 Certificate Extension List
Definition at line 539 of file pkix_types.h.
|
default |
Referenced by Extensions(), Extensions(), operator=(), and operator=().
|
default |
References Extensions().
|
default |
References Extensions().
|
overridedefault |
References BOTAN_UNSTABLE_API.
| void Botan::Extensions::add | ( | std::unique_ptr< Certificate_Extension > | extn, |
| bool | critical = false ) |
Adds a new extension to the list.
| extn | pointer to the certificate extension (Extensions takes ownership) |
| critical | whether this extension should be marked as critical |
| Invalid_Argument | if the extension is already present in the list |
Definition at line 166 of file x509_ext.cpp.
| bool Botan::Extensions::add_new | ( | std::unique_ptr< Certificate_Extension > | extn, |
| bool | critical = false ) |
Adds a new extension to the list unless it already exists. If the extension already exists within the Extensions object, the extn pointer will be deleted.
| extn | pointer to the certificate extension (Extensions takes ownership) |
| critical | whether this extension should be marked as critical |
Definition at line 179 of file x509_ext.cpp.
Referenced by Botan::X509::create_cert_req(), and Botan::X509::create_self_signed_cert().
|
inherited |
Return the encoding of this object. This is a convenience method when just one object needs to be serialized. Use DER_Encoder for complicated encodings.
Definition at line 20 of file asn1_obj.cpp.
References encode_into().
Referenced by decode_from(), Botan::Certificate_Store_In_SQL::find_all_certs(), Botan::Certificate_Store_In_SQL::find_cert(), Botan::X509_Certificate::fingerprint(), Botan::Certificate_Store_In_SQL::insert_cert(), Botan::X509_Object::PEM_encode(), Botan::PSS_Params::PSS_Params(), and Botan::Certificate_Store_In_SQL::revoke_cert().
| bool Botan::Extensions::critical_extension_set | ( | const OID & | oid | ) | const |
Return true if an extension was set and marked critical
Definition at line 215 of file x509_ext.cpp.
Referenced by Botan::X509_Certificate::is_critical().
| std::vector< OID > Botan::Extensions::critical_extensions | ( | ) | const |
Return the set of critical extensions in the order they appeared in the extension list (This may be an empty vector)
Definition at line 109 of file x509_ext.cpp.
References BOTAN_ASSERT_NOMSG.
Referenced by Botan::OCSP::SingleResponse::decode_from(), and Botan::OCSP::Response::Response().
|
overridevirtual |
Decode whatever this object is from from
| from | the BER_Decoder that will be read from |
Implements Botan::ASN1_Object.
Definition at line 288 of file x509_ext.cpp.
References Botan::Boolean, Botan::BER_Decoder::decode(), Botan::BER_Decoder::decode_optional(), Botan::BER_Decoder::end_cons(), Botan::BER_Decoder::more_items(), Botan::OctetString, Botan::BER_Decoder::start_sequence(), 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 268 of file x509_ext.cpp.
References Botan::DER_Encoder::encode(), Botan::DER_Encoder::encode_optional(), Botan::DER_Encoder::end_cons(), Botan::OctetString, and Botan::DER_Encoder::start_sequence().
| bool Botan::Extensions::extension_set | ( | const OID & | oid | ) | const |
Return true if an extension was set
Definition at line 211 of file x509_ext.cpp.
Referenced by botan_x509_cert_issuer_alternative_names(), and botan_x509_cert_subject_alternative_names().
| std::vector< std::pair< std::unique_ptr< Certificate_Extension >, bool > > Botan::Extensions::extensions | ( | ) | const |
Returns a copy of the list of extensions together with the corresponding criticality flag. All extensions are encoded as some object, falling back to Unknown_Extension class which simply allows reading the bytes as well as the criticality flag.
Definition at line 248 of file x509_ext.cpp.
Referenced by Botan::PKIX::check_chain(), and Botan::X509_CA::choose_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, including any extensions encoded as Unknown_Extension
Definition at line 257 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 241 of file x509_ext.cpp.
References get_extension_object().
| std::vector< uint8_t > Botan::Extensions::get_extension_bits | ( | const OID & | oid | ) | const |
Return the raw bytes of the extension Will throw if OID was not set as an extension.
Definition at line 223 of file x509_ext.cpp.
| const Certificate_Extension * Botan::Extensions::get_extension_object | ( | const OID & | oid | ) | const |
Look up an object in the extensions, based on OID Returns nullptr if not set, if the extension was either absent or not handled. The pointer returned is owned by the Extensions object. This would be better with an optional<T> return value
Definition at line 232 of file x509_ext.cpp.
Referenced by get(), and get_extension_object_as().
|
inline |
Definition at line 551 of file pkix_types.h.
References get_extension_object().
Referenced by Botan::X509_CRL::has_matching_distribution_point().
|
inline |
Return the set of extensions in the order they appeared in the certificate (or as they were added, if constructed)
Definition at line 570 of file pkix_types.h.
Referenced by Botan::PKIX::check_chain().
|
inline |
Searches for an extension by OID and returns the result decoding it to some arbitrary extension type chosen by the application.
Only the unknown extensions, that is, extensions types that are not declared in this header, are searched for by this function.
Definition at line 648 of file pkix_types.h.
|
default |
References Extensions().
|
default |
References Extensions().
| bool Botan::Extensions::remove | ( | const OID & | oid | ) |
Remove an extension from the list. Returns true if the extension had been set, false otherwise.
Definition at line 191 of file x509_ext.cpp.
Referenced by replace().
| void Botan::Extensions::replace | ( | std::unique_ptr< 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 201 of file x509_ext.cpp.
References remove().
Referenced by Botan::X509::create_cert_req(), and Botan::X509::create_self_signed_cert().