Botan 3.6.1
Crypto and TLS for C&
|
#include <pkix_types.h>
Public Member Functions | |
void | add_attribute (std::string_view type, std::string_view value) |
void | add_dn (const X509_DN &dn) |
Add a directory name to this AlternativeName. | |
void | add_dns (std::string_view dns) |
Add a DNS name to this AlternativeName. | |
void | add_email (std::string_view addr) |
Add a URI to this AlternativeName. | |
void | add_ipv4_address (uint32_t ipv4) |
Add an IP address to this alternative name. | |
void | add_other_name (const OID &oid, const ASN1_String &value) |
Add an "OtherName" identified by object identifier to this AlternativeName. | |
void | add_othername (const OID &oid, std::string_view value, ASN1_Type type) |
void | add_uri (std::string_view uri) |
Add a URI to this AlternativeName. | |
AlternativeName () | |
Create an empty name. | |
AlternativeName (std::string_view email_addr, std::string_view uri="", std::string_view dns="", std::string_view ip_address="") | |
std::vector< uint8_t > | BER_encode () const |
std::multimap< std::string, std::string > | contents () const |
size_t | count () const |
void | decode_from (BER_Decoder &) override |
const std::set< X509_DN > & | directory_names () const |
Return the set of directory names included in this alternative name. | |
X509_DN | dn () const |
const std::set< std::string > & | dns () const |
Return the set of DNS names included in this alternative name. | |
const std::set< std::string > & | email () const |
Return the set of email addresses included in this alternative name. | |
void | encode_into (DER_Encoder &) const override |
std::vector< std::string > | get_attribute (std::string_view attr) const |
std::multimap< std::string, std::string, std::less<> > | get_attributes () const |
std::string | get_first_attribute (std::string_view attr) const |
std::multimap< OID, ASN1_String > | get_othernames () const |
bool | has_field (std::string_view attr) const |
bool | has_items () const |
Return true if this has any names set. | |
const std::set< uint32_t > & | ipv4_address () const |
Return the set of IPv4 addresses included in this alternative name. | |
const std::set< std::pair< OID, ASN1_String > > & | other_names () const |
Return the set of "other names" included in this alternative name. | |
const std::set< std::string > & | uris () const |
Return the set of URIs included in this alternative name. | |
Alternative Name
Definition at line 119 of file pkix_types.h.
|
inline |
Botan::AlternativeName::AlternativeName | ( | std::string_view | email_addr, |
std::string_view | uri = "", | ||
std::string_view | dns = "", | ||
std::string_view | ip_address = "" ) |
Definition at line 20 of file asn1_alt_name.cpp.
References add_dns(), add_email(), add_ipv4_address(), add_uri(), dns(), Botan::fmt(), and Botan::string_to_ipv4().
void Botan::AlternativeName::add_attribute | ( | std::string_view | type, |
std::string_view | value ) |
Definition at line 45 of file asn1_alt_name.cpp.
References add_dn(), add_dns(), add_email(), add_ipv4_address(), add_uri(), dn(), Botan::fmt(), and Botan::string_to_ipv4().
void Botan::AlternativeName::add_dn | ( | const X509_DN & | dn | ) |
Add a directory name to this AlternativeName.
Definition at line 40 of file alt_name.cpp.
References dn().
Referenced by add_attribute(), and decode_from().
void Botan::AlternativeName::add_dns | ( | std::string_view | dns | ) |
Add a DNS name to this AlternativeName.
Definition at line 30 of file alt_name.cpp.
References dns(), and Botan::tolower_string().
Referenced by add_attribute(), AlternativeName(), and decode_from().
void Botan::AlternativeName::add_email | ( | std::string_view | addr | ) |
Add a URI to this AlternativeName.
Definition at line 24 of file alt_name.cpp.
Referenced by add_attribute(), AlternativeName(), and decode_from().
void Botan::AlternativeName::add_ipv4_address | ( | uint32_t | ipv4 | ) |
Add an IP address to this alternative name.
Definition at line 44 of file alt_name.cpp.
Referenced by add_attribute(), AlternativeName(), and decode_from().
void Botan::AlternativeName::add_other_name | ( | const OID & | oid, |
const ASN1_String & | value ) |
Add an "OtherName" identified by object identifier to this AlternativeName.
Definition at line 36 of file alt_name.cpp.
Referenced by add_othername().
void Botan::AlternativeName::add_othername | ( | const OID & | oid, |
std::string_view | value, | ||
ASN1_Type | type ) |
Definition at line 75 of file asn1_alt_name.cpp.
References add_other_name().
Referenced by decode_from().
void Botan::AlternativeName::add_uri | ( | std::string_view | uri | ) |
Add a URI to this AlternativeName.
Definition at line 18 of file alt_name.cpp.
Referenced by add_attribute(), AlternativeName(), and decode_from().
|
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 19 of file asn1_obj.cpp.
References Botan::ASN1_Object::encode_into().
Referenced by Botan::PSS_Params::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(), and Botan::Certificate_Store_In_SQL::revoke_cert().
std::multimap< std::string, std::string > Botan::AlternativeName::contents | ( | ) | const |
Definition at line 85 of file asn1_alt_name.cpp.
References directory_names(), dns(), email(), ipv4_address(), Botan::ipv4_to_string(), other_names(), and uris().
Referenced by get_attributes().
size_t Botan::AlternativeName::count | ( | ) | const |
Return the total number of names in this AlternativeName
This only counts names which were parsed, ignoring names which were of some unknown type
Definition at line 48 of file alt_name.cpp.
References BOTAN_ASSERT_IS_SOME, and Botan::checked_add().
Referenced by has_items(), and Botan::GeneralName::matches().
|
overridevirtual |
Decode whatever this object is from from
from | the BER_Decoder that will be read from |
Implements Botan::ASN1_Object.
Definition at line 112 of file alt_name.cpp.
References add_dn(), add_dns(), add_email(), add_ipv4_address(), add_othername(), add_uri(), Botan::BER_Object::bits(), Botan::Constructed, Botan::ContextSpecific, Botan::BER_Decoder::decode(), dn(), Botan::ExplicitContextSpecific, Botan::BER_Object::get_class(), Botan::BER_Decoder::get_next_object(), Botan::BER_Object::is_a(), Botan::ASN1_String::is_string_type(), Botan::BER_Object::length(), Botan::load_be(), Botan::BER_Decoder::more_items(), Botan::BER_Decoder::start_sequence(), Botan::ASN1::to_string(), Botan::BER_Object::type(), Botan::Universal, and Botan::BER_Decoder::verify_end().
|
inline |
Return the set of directory names included in this alternative name.
Definition at line 164 of file pkix_types.h.
Referenced by contents(), dn(), get_attribute(), and Botan::GeneralName::matches().
X509_DN Botan::AlternativeName::dn | ( | ) | const |
Definition at line 167 of file asn1_alt_name.cpp.
References directory_names(), and dn().
Referenced by add_attribute(), add_dn(), decode_from(), and dn().
|
inline |
Return the set of DNS names included in this alternative name.
Definition at line 152 of file pkix_types.h.
Referenced by add_dns(), AlternativeName(), contents(), get_attribute(), and Botan::GeneralName::matches().
|
inline |
Return the set of email addresses included in this alternative name.
Definition at line 149 of file pkix_types.h.
Referenced by contents(), and get_attribute().
|
overridevirtual |
Encode whatever this object is into to
to | the DER_Encoder that will be written to |
Implements Botan::ASN1_Object.
Definition at line 59 of file alt_name.cpp.
References Botan::DER_Encoder::add_object(), Botan::ContextSpecific, Botan::DER_Encoder::encode(), Botan::DER_Encoder::end_cons(), Botan::DER_Encoder::end_explicit(), Botan::ExplicitContextSpecific, Botan::Ia5String, name, Botan::DER_Encoder::start_explicit(), Botan::DER_Encoder::start_sequence(), Botan::store_be(), and Botan::ASN1_String::value().
std::vector< std::string > Botan::AlternativeName::get_attribute | ( | std::string_view | attr | ) | const |
Definition at line 139 of file asn1_alt_name.cpp.
References directory_names(), dns(), email(), ipv4_address(), Botan::ipv4_to_string(), and uris().
Referenced by get_first_attribute(), and has_field().
std::multimap< std::string, std::string, std::less<> > Botan::AlternativeName::get_attributes | ( | ) | const |
Definition at line 115 of file asn1_alt_name.cpp.
References contents().
std::string Botan::AlternativeName::get_first_attribute | ( | std::string_view | attr | ) | const |
Definition at line 129 of file asn1_alt_name.cpp.
References get_attribute().
std::multimap< OID, ASN1_String > Botan::AlternativeName::get_othernames | ( | ) | const |
bool Botan::AlternativeName::has_field | ( | std::string_view | attr | ) | const |
Definition at line 125 of file asn1_alt_name.cpp.
References get_attribute().
bool Botan::AlternativeName::has_items | ( | ) | const |
Return true if this has any names set.
Definition at line 55 of file alt_name.cpp.
References count().
|
inline |
Return the set of IPv4 addresses included in this alternative name.
Definition at line 155 of file pkix_types.h.
Referenced by contents(), get_attribute(), Botan::GeneralName::matches(), and Botan::X509_Certificate::matches_dns_name().
|
inline |
Return the set of "other names" included in this alternative name.
Definition at line 159 of file pkix_types.h.
Referenced by contents().
|
inline |
Return the set of URIs included in this alternative name.
Definition at line 146 of file pkix_types.h.
Referenced by contents(), Botan::Cert_Extension::CRL_Distribution_Points::Distribution_Point::encode_into(), and get_attribute().