|
Botan 3.11.0
Crypto and TLS for C&
|
X.509 GeneralName Type. More...
#include <pkix_types.h>
Public Types | |
| enum | MatchResult : uint8_t { All , Some , None , NotFound , UnknownType } |
| enum class | NameType : uint8_t { Unknown = 0 , RFC822 = 1 , DNS = 2 , URI = 3 , DN = 4 , IPv4 = 5 , Other = 6 } |
Public Member Functions | |
| std::vector< uint8_t > | BER_encode () const |
| std::vector< uint8_t > | binary_name () const |
| void | decode_from (BER_Decoder &from) override |
| void | encode_into (DER_Encoder &to) const override |
| GeneralName ()=default | |
| MatchResult | matches (const X509_Certificate &cert) const |
| bool | matches_dn (const X509_DN &dn) const |
| bool | matches_dns (const std::string &dns_name) const |
| bool | matches_ipv4 (uint32_t ip) const |
| std::string | name () const |
| std::string | type () const |
| NameType | type_code () const |
Static Public Member Functions | |
| static GeneralName | directory_name (Botan::X509_DN dn) |
| static GeneralName | dns (std::string_view dns) |
| static GeneralName | email (std::string_view email) |
| static GeneralName | ipv4_address (uint32_t ipv4) |
| static GeneralName | ipv4_address (uint32_t ipv4, uint32_t mask) |
| static GeneralName | uri (std::string_view uri) |
X.509 GeneralName Type.
Handles parsing GeneralName types in their BER and canonical string encoding. Allows matching GeneralNames against each other using the rules laid out in the RFC 5280, sec. 4.2.1.10 (Name Constraints).
This entire class is deprecated and will be removed in a future major release
Definition at line 274 of file pkix_types.h.
| enum Botan::GeneralName::MatchResult : uint8_t |
| Enumerator | |
|---|---|
| All | |
| Some | |
| None | |
| NotFound | |
| UnknownType | |
Definition at line 276 of file pkix_types.h.
|
strong |
| Enumerator | |
|---|---|
| Unknown | |
| RFC822 | |
| DNS | |
| URI | |
| DN | |
| IPv4 | |
| Other | |
Definition at line 284 of file pkix_types.h.
|
default |
References decode_from(), directory_name(), dns(), email(), encode_into(), GeneralName(), ipv4_address(), and uri().
Referenced by directory_name(), dns(), email(), GeneralName(), ipv4_address(), ipv4_address(), and uri().
|
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::Certificate_Store_Windows::find_cert_by_issuer_dn_and_serial_number(), 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().
| std::vector< uint8_t > Botan::GeneralName::binary_name | ( | ) | const |
Definition at line 109 of file name_constraint.cpp.
References Botan::concat(), Botan::ASN1::put_in_sequence(), and Botan::store_be().
Referenced by botan_x509_general_name_view_binary_value().
|
overridevirtual |
Decode whatever this object is from from
| from | the BER_Decoder that will be read from |
Implements Botan::ASN1_Object.
Definition at line 130 of file name_constraint.cpp.
References Botan::BER_Object::bits(), Botan::Constructed, Botan::ContextSpecific, Botan::X509_DN::decode_from(), DN, DNS, Botan::ExplicitContextSpecific, Botan::BER_Decoder::get_next_object(), IPv4, Botan::BER_Object::is_a(), Botan::BER_Object::length(), Botan::load_be(), Other, RFC822, Botan::ASN1::to_string(), Unknown, and URI.
Referenced by GeneralName().
|
static |
Definition at line 74 of file name_constraint.cpp.
References GeneralName().
Referenced by GeneralName().
|
static |
Definition at line 66 of file name_constraint.cpp.
References dns(), and GeneralName().
Referenced by dns(), GeneralName(), and matches().
|
static |
Definition at line 62 of file name_constraint.cpp.
References email(), and GeneralName().
Referenced by email(), and GeneralName().
|
overridevirtual |
Encode whatever this object is into to
| to | the DER_Encoder that will be written to |
Implements Botan::ASN1_Object.
Definition at line 126 of file name_constraint.cpp.
Referenced by GeneralName().
|
static |
Definition at line 78 of file name_constraint.cpp.
References GeneralName(), and ipv4_address().
Referenced by GeneralName(), and ipv4_address().
|
static |
Definition at line 82 of file name_constraint.cpp.
References GeneralName().
| GeneralName::MatchResult Botan::GeneralName::matches | ( | const X509_Certificate & | cert | ) | const |
Checks whether a given certificate (partially) matches this name.
| cert | certificate to be matched |
Definition at line 194 of file name_constraint.cpp.
References All, Botan::AlternativeName::count(), Botan::AlternativeName::directory_names(), DN, DNS, Botan::AlternativeName::dns(), dns(), Botan::X509_DN::get_attribute(), IPv4, Botan::AlternativeName::ipv4_address(), matches_dn(), matches_dns(), None, NotFound, Some, Botan::string_to_ipv4(), Botan::X509_Certificate::subject_alt_name(), Botan::X509_Certificate::subject_dn(), and UnknownType.
| bool Botan::GeneralName::matches_dn | ( | const X509_DN & | dn | ) | const |
Definition at line 186 of file name_constraint.cpp.
References DN, and matches_dn().
Referenced by matches(), and matches_dn().
| bool Botan::GeneralName::matches_dns | ( | const std::string & | dns_name | ) | const |
Definition at line 170 of file name_constraint.cpp.
References DNS, and matches_dns().
Referenced by matches(), and matches_dns().
| bool Botan::GeneralName::matches_ipv4 | ( | uint32_t | ip | ) | const |
Definition at line 178 of file name_constraint.cpp.
References IPv4.
| std::string Botan::GeneralName::name | ( | ) | const |
Definition at line 86 of file name_constraint.cpp.
References BOTAN_ASSERT_UNREACHABLE, Botan::fmt(), and Botan::ipv4_to_string().
Referenced by botan_x509_general_name_view_string_value(), and Botan::operator<<().
| std::string Botan::GeneralName::type | ( | ) | const |
Definition at line 33 of file name_constraint.cpp.
References BOTAN_ASSERT_UNREACHABLE, DN, DNS, IPv4, Other, RFC822, Unknown, and URI.
Referenced by Botan::operator<<().
|
inline |
Definition at line 311 of file pkix_types.h.
References type_code().
Referenced by botan_x509_general_name_get_type(), botan_x509_general_name_view_binary_value(), botan_x509_general_name_view_string_value(), and type_code().
|
static |
Definition at line 70 of file name_constraint.cpp.
References GeneralName(), and uri().
Referenced by GeneralName(), and uri().