|
Botan 3.13.0
Crypto and TLS for C&
|
#include <pkix_types.h>
Public Member Functions | |
| const std::vector< uint8_t > & | _canonical_bytes () const |
| void | add_attribute (const OID &oid, const ASN1_String &val) |
| void | add_attribute (const OID &oid, std::string_view val) |
| void | add_attribute (std::string_view key, std::string_view val) |
| void | add_rdn (std::vector< std::pair< OID, ASN1_String > > rdn) |
| std::vector< uint8_t > | BER_encode () const |
| std::multimap< std::string, std::string > | contents () const |
| size_t | count () const |
| void | decode_from (BER_Decoder &from) override |
| std::vector< uint8_t > | DER_encode () const |
| std::vector< std::pair< OID, ASN1_String > > | dn_info () const |
| bool | empty () const |
| void | encode_into (DER_Encoder &to) const override |
| std::vector< std::string > | get_attribute (std::string_view attr) const |
| std::multimap< OID, std::string > | get_attributes () const |
| const std::vector< uint8_t > & | get_bits () const |
| ASN1_String | get_first_attribute (const OID &oid) const |
| std::string | get_first_attribute (std::string_view attr) const |
| bool | has_field (const OID &oid) const |
| bool | has_field (std::string_view attr) const |
| const std::vector< std::vector< std::pair< OID, ASN1_String > > > & | rdns () const |
| std::string | to_string () const |
| X509_DN ()=default | |
| X509_DN (const std::multimap< OID, std::string > &args) | |
| X509_DN (const std::multimap< std::string, std::string > &args) | |
| X509_DN (std::initializer_list< std::pair< std::string_view, std::string_view > > args) | |
Static Public Member Functions | |
| static std::string | deref_info_field (std::string_view key) |
| static size_t | lookup_ub (const OID &oid) |
| static std::optional< X509_DN > | parse (std::string_view str) |
Distinguished Name
Definition at line 157 of file pkix_types.h.
|
inline |
Definition at line 161 of file pkix_types.h.
References add_attribute().
|
inlineexplicit |
Since DN matching for Name Constraints requires preserving order and multimaps have sorted keys, this constructor is deprecated.
Definition at line 172 of file pkix_types.h.
References add_attribute(), and X509_DN().
|
inlineexplicit |
Since DN matching for Name Constraints requires preserving order and multimaps have sorted keys, this constructor is deprecated.
Definition at line 183 of file pkix_types.h.
References add_attribute(), and X509_DN().
|
inline |
Return a canonical byte encoding
Internal interface, not covered by SemVer
Definition at line 274 of file pkix_types.h.
Referenced by Botan::operator<(), Botan::operator==(), and Botan::x509_dn_subtree_match().
| void Botan::X509_DN::add_attribute | ( | const OID & | oid, |
| const ASN1_String & | val ) |
Definition at line 144 of file x509_dn.cpp.
References Botan::ASN1_String::empty().
|
inline |
Definition at line 247 of file pkix_types.h.
References add_attribute(), and add_attribute().
Referenced by add_attribute().
| void Botan::X509_DN::add_attribute | ( | std::string_view | key, |
| std::string_view | val ) |
Definition at line 137 of file x509_dn.cpp.
References add_attribute(), and Botan::OID::from_string().
Referenced by add_attribute(), add_attribute(), X509_DN(), X509_DN(), and X509_DN().
| void Botan::X509_DN::add_rdn | ( | std::vector< std::pair< OID, ASN1_String > > | rdn | ) |
Append a complete RDN. The provided AVAs become one RelativeDistinguishedName (X.501 SET OF AttributeTypeAndValue). An empty input is ignored.
Definition at line 155 of file x509_dn.cpp.
Referenced by Botan::AlternativeName::dn(), and parse().
|
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 21 of file asn1_obj.cpp.
References encode_into().
Referenced by decode_from(), Botan::PKCS12::export_to(), 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::PSS_Params::PSS_Params().
| std::multimap< std::string, std::string > Botan::X509_DN::contents | ( | ) | const |
Definition at line 191 of file x509_dn.cpp.
|
inline |
Number of relative distinguished names (RDNs) in the DN. Note: prior to multi-AVA RDN support this returned the total number of AVAs; the two differ only when the DN contains a multi-valued RDN.
Definition at line 209 of file pkix_types.h.
Referenced by Botan::NameConstraints::is_excluded(), and Botan::NameConstraints::is_permitted().
|
overridevirtual |
Decode whatever this object is from from
| from | the BER_Decoder that will be read from |
Implements Botan::ASN1_Object.
Definition at line 408 of file x509_dn.cpp.
References Botan::BER_Decoder::decode(), Botan::BER_Decoder::end_cons(), Botan::BER_Decoder::limits(), Botan::BER_Decoder::more_items(), Botan::BER_Decoder::raw_bytes(), rdns(), Botan::BER_Decoder::start_sequence(), and Botan::BER_Decoder::start_set().
Referenced by Botan::Certificate_Store_In_SQL::all_subjects(), and Botan::GeneralName::decode_from().
| std::vector< uint8_t > Botan::X509_DN::DER_encode | ( | ) | const |
Definition at line 373 of file x509_dn.cpp.
References encode_into().
|
static |
Definition at line 264 of file x509_dn.cpp.
Referenced by get_attribute(), get_first_attribute(), has_field(), and parse().
| std::vector< std::pair< OID, ASN1_String > > Botan::X509_DN::dn_info | ( | ) | const |
Return the DN attributes as a flat sequence of AVAs in decoded order. RDN structure is not preserved in this view; prefer rdns() to retain it.
Definition at line 164 of file x509_dn.cpp.
|
inline |
Definition at line 202 of file pkix_types.h.
Referenced by Botan::NameConstraints::is_permitted().
|
overridevirtual |
Encode whatever this object is into to
| to | the DER_Encoder that will be written to |
Implements Botan::ASN1_Object.
Definition at line 383 of file x509_dn.cpp.
References Botan::DER_Encoder::encode(), Botan::DER_Encoder::end_cons(), Botan::DER_Encoder::raw_bytes(), Botan::DER_Encoder::start_sequence(), and Botan::DER_Encoder::start_set().
Referenced by DER_encode().
| std::vector< std::string > Botan::X509_DN::get_attribute | ( | std::string_view | attr | ) | const |
Definition at line 245 of file x509_dn.cpp.
References deref_info_field(), and Botan::OID::from_string().
Referenced by Botan::NameConstraints::is_excluded(), Botan::NameConstraints::is_permitted(), and Botan::GeneralName::matches().
| std::multimap< OID, std::string > Botan::X509_DN::get_attributes | ( | ) | const |
Definition at line 177 of file x509_dn.cpp.
|
inline |
Definition at line 198 of file pkix_types.h.
Referenced by botan_x509_crl_view_binary_values().
| ASN1_String Botan::X509_DN::get_first_attribute | ( | const OID & | oid | ) | const |
Definition at line 230 of file x509_dn.cpp.
Referenced by get_first_attribute().
| std::string Botan::X509_DN::get_first_attribute | ( | std::string_view | attr | ) | const |
Definition at line 225 of file x509_dn.cpp.
References deref_info_field(), Botan::OID::from_string(), get_first_attribute(), and Botan::ASN1_String::value().
| bool Botan::X509_DN::has_field | ( | const OID & | oid | ) | const |
Definition at line 213 of file x509_dn.cpp.
Referenced by has_field().
| bool Botan::X509_DN::has_field | ( | std::string_view | attr | ) | const |
Definition at line 202 of file x509_dn.cpp.
References deref_info_field(), Botan::OID::from_string(), has_field(), and Botan::OID::has_value().
|
static |
Lookup upper bounds in characters for the length of distinguished name fields as given in RFC 5280, Appendix A.
| oid | the oid of the DN to lookup |
Definition at line 16 of file x509_dn_ub.cpp.
References Botan::is_sub_element_of().
Referenced by Botan::PKIX::check_chain().
|
static |
Parse the string representation of a distinguished name.
The grammar accepted is a subset of RFC 4514 Section 3, but also accepts quoted-value forms ala RFC 2253. The entire input must be consumed.
| str | the string to parse |
str is not a well-formed DN Definition at line 554 of file x509_dn.cpp.
References add_rdn(), deref_info_field(), Botan::OID::from_string(), Botan::None, and X509_DN().
Referenced by Botan::AlternativeName::add_attribute(), and Botan::operator>>().
|
inline |
Return the DN as a sequence of RDNs. Each RDN is an X.501 SET OF AttributeTypeAndValue; the inner vector preserves the decoded order but RDN equality is set-based per RFC 5280 7.1.
Definition at line 229 of file pkix_types.h.
Referenced by Botan::PKIX::check_chain(), decode_from(), and Botan::operator<<().
| std::string Botan::X509_DN::to_string | ( | ) | const |
Definition at line 485 of file x509_dn.cpp.
Referenced by Botan::Flatfile_Certificate_Store::Flatfile_Certificate_Store().