|
Botan
2.13.0
Crypto and TLS for C++11
|
#include <asn1_oid.h>
Public Member Functions | |
| std::string | as_string () const |
| std::vector< uint8_t > | BER_encode () const |
| void | clear () |
| void | decode_from (class BER_Decoder &) override |
| bool | empty () const |
| void | encode_into (class DER_Encoder &) const override |
| const std::vector< uint32_t > & | get_components () const |
| const std::vector< uint32_t > & | get_id () const |
| bool | has_value () const |
| OID () | |
| OID (const std::string &str) | |
| OID (std::initializer_list< uint32_t > init) | |
| OID (std::vector< uint32_t > &&init) | |
| OID & | operator+= (uint32_t new_comp) |
| bool | operator== (const OID &other) const |
| std::string | to_formatted_string () const |
| std::string | to_string () const |
Static Public Member Functions | |
| static OID | from_string (const std::string &str) |
This class represents ASN.1 object identifiers.
Definition at line 20 of file asn1_oid.h.
|
inlineexplicit |
Create an uninitialied OID object
Definition at line 27 of file asn1_oid.h.
Referenced by from_string().
|
explicit |
Construct an OID from a string.
| str | a string in the form "a.b.c" etc., where a,b,c are numbers |
Definition at line 82 of file asn1_oid.cpp.
|
inlineexplicit |
|
inlineexplicit |
|
inline |
Get this OID as a string
Definition at line 79 of file asn1_oid.h.
References Botan::to_string().
|
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 16 of file asn1_obj.cpp.
References Botan::ASN1_Object::encode_into().
Referenced by Botan::PSSR::config_for_x509(), 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(), and Botan::Certificate_Store_In_SQL::revoke_cert().
|
inline |
Reset this instance to an empty OID.
Definition at line 108 of file asn1_oid.h.
|
overridevirtual |
Decode whatever this object is from from
| from | the BER_Decoder that will be read from |
Implements Botan::ASN1_Object.
Definition at line 177 of file asn1_oid.cpp.
References Botan::BER_Object::bits(), Botan::BER_Decoder::get_next_object(), Botan::BER_Object::length(), Botan::OBJECT_ID, and Botan::BER_Object::tagging().
|
inline |
Find out whether this OID is empty
Definition at line 59 of file asn1_oid.h.
Referenced by Botan::EC_Group::DER_encode(), Botan::EC_PrivateKey::EC_PrivateKey(), Botan::EC_PublicKey::EC_PublicKey(), Botan::Public_Key::get_oid(), and Botan::EC_PublicKey::set_parameter_encoding().
|
overridevirtual |
Encode whatever this object is into to
| to | the DER_Encoder that will be written to |
Implements Botan::ASN1_Object.
Definition at line 143 of file asn1_oid.cpp.
References Botan::DER_Encoder::add_object(), BOTAN_ASSERT, Botan::high_bit(), Botan::OBJECT_ID, and Botan::UNIVERSAL.
|
static |
Construct an OID from a string.
| str | a string in the form "a.b.c" etc., where a,b,c are numbers or any known OID name (for example "RSA" or "X509v3.SubjectKeyIdentifier") |
Definition at line 62 of file asn1_oid.cpp.
References has_value(), OID(), and Botan::OIDS::str2oid_or_empty().
Referenced by Botan::X509_DN::add_attribute(), Botan::X509_Cert_Options::add_ex_constraint(), Botan::X509_Certificate::allowed_extended_usage(), Botan::EMSA1::config_for_x509(), Botan::EMSA_PKCS1v15::config_for_x509(), Botan::PKCS10_Request::constraints(), Botan::EC_Group::EC_Group(), Botan::PKCS10_Request::ex_constraints(), Botan::X509_DN::get_attribute(), Botan::X509_DN::get_first_attribute(), Botan::X509_Certificate::has_ex_constraint(), Botan::PKCS10_Request::is_CA(), Botan::X509_Certificate::is_critical(), Botan::PKCS10_Request::path_limit(), and Botan::TLS::Callbacks::tls_ecdh_agree().
|
inline |
Get this OID as list (vector) of its components.
Definition at line 71 of file asn1_oid.h.
Referenced by Botan::operator+(), Botan::operator<(), and Botan::parse_asn1_oid().
|
inline |
Definition at line 73 of file asn1_oid.h.
|
inline |
Find out whether this OID has a value
Definition at line 65 of file asn1_oid.h.
Referenced by Botan::X509::create_self_signed_cert(), Botan::EC_Group::EC_Group(), from_string(), and Botan::X509_DN::has_field().
|
inline |
Add a component to this OID.
| new_comp | the new component to add to the end of this OID |
Definition at line 115 of file asn1_oid.h.
|
inline |
Compare two OIDs.
Definition at line 100 of file asn1_oid.h.
| std::string Botan::OID::to_formatted_string | ( | ) | const |
If there is a known name associated with this OID, return that. Otherwise return the result of to_string
Definition at line 110 of file asn1_oid.cpp.
References Botan::OIDS::oid2str_or_empty(), and to_string().
Referenced by Botan::X509_Object::hash_used_for_signature(), Botan::OCSP::CertID::is_id_for(), Botan::load_private_key(), Botan::load_public_key(), Botan::X942_PRF::name(), Botan::X509_Certificate::to_string(), Botan::X509_Object::verify_signature(), and Botan::OCSP::Response::verify_signature().
| std::string Botan::OID::to_string | ( | ) | const |
Get this OID as a dotted-decimal string
Definition at line 98 of file asn1_oid.cpp.
Referenced by Botan::EC_Group::EC_Group(), Botan::X509_Object::hash_used_for_signature(), Botan::OIDS::oid2str_or_throw(), to_formatted_string(), and Botan::X509_Certificate::to_string().
1.8.9.1