|
Botan 3.12.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 , IPv6 = 6 , Other = 7 } |
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 (IPv4Address ip) const |
| bool | matches_ipv4 (uint32_t ip) const |
| bool | matches_ipv6 (const IPv6Address &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 (const IPv4Subnet &subnet) |
| static GeneralName | ipv4_address (IPv4Address ipv4) |
| static GeneralName | ipv4_address (uint32_t ipv4) |
| static GeneralName | ipv4_address (uint32_t ipv4, uint32_t mask) |
| static GeneralName | ipv6_address (const IPv6Address &ipv6) |
| static GeneralName | ipv6_address (const IPv6Subnet &subnet) |
| static GeneralName | uri (std::string_view uri) |
Friends | |
| class | NameConstraints |
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 286 of file pkix_types.h.
| enum Botan::GeneralName::MatchResult : uint8_t |
| Enumerator | |
|---|---|
| All | |
| Some | |
| None | |
| NotFound | |
| UnknownType | |
Definition at line 288 of file pkix_types.h.
|
strong |
| Enumerator | |
|---|---|
| Unknown | |
| RFC822 | |
| DNS | |
| URI | |
| DN | |
| IPv4 | |
| IPv6 | |
| Other | |
Definition at line 296 of file pkix_types.h.
|
default |
References decode_from(), directory_name(), dns(), email(), encode_into(), GeneralName(), ipv4_address(), ipv6_address(), and uri().
Referenced by directory_name(), dns(), email(), GeneralName(), ipv4_address(), ipv4_address(), ipv4_address(), ipv4_address(), ipv6_address(), ipv6_address(), NameConstraints, 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::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 123 of file name_constraint.cpp.
References Botan::ASN1::put_in_sequence().
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 139 of file name_constraint.cpp.
References Botan::BER_Object::bits(), Botan::Constructed, Botan::ContextSpecific, Botan::X509_DN::decode_from(), DN, DNS, dns(), Botan::ExplicitContextSpecific, Botan::IPv4Subnet::from_address_and_mask(), Botan::IPv6Subnet::from_address_and_mask(), Botan::BER_Decoder::get_next_object(), IPv4, IPv6, Botan::BER_Object::is_a(), Botan::BER_Object::length(), Botan::BER_Decoder::limits(), Other, RFC822, Botan::ASN1::to_string(), Unknown, and URI.
Referenced by GeneralName().
|
static |
Definition at line 69 of file name_constraint.cpp.
References GeneralName().
Referenced by GeneralName().
|
static |
Definition at line 61 of file name_constraint.cpp.
References dns(), and GeneralName().
Referenced by decode_from(), dns(), GeneralName(), and matches().
|
static |
Definition at line 57 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 135 of file name_constraint.cpp.
Referenced by GeneralName().
|
static |
Definition at line 89 of file name_constraint.cpp.
References GeneralName().
|
static |
Definition at line 85 of file name_constraint.cpp.
References GeneralName(), and Botan::IPv4Subnet::host().
|
static |
Definition at line 73 of file name_constraint.cpp.
References GeneralName(), and ipv4_address().
Referenced by GeneralName(), and ipv4_address().
|
static |
Definition at line 77 of file name_constraint.cpp.
References Botan::IPv4Subnet::from_address_and_mask(), and GeneralName().
|
static |
Definition at line 93 of file name_constraint.cpp.
References GeneralName(), and Botan::IPv6Subnet::host().
Referenced by GeneralName().
|
static |
Definition at line 97 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 223 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(), IPv6, Botan::AlternativeName::ipv6_address(), matches_dn(), matches_dns(), matches_ipv6(), 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 215 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 193 of file name_constraint.cpp.
References DNS, and matches_dns().
Referenced by matches(), and matches_dns().
|
inline |
Definition at line 355 of file pkix_types.h.
References matches_ipv4(), and matches_ipv4().
Referenced by matches_ipv4().
| bool Botan::GeneralName::matches_ipv4 | ( | uint32_t | ip | ) | const |
Definition at line 201 of file name_constraint.cpp.
References IPv4.
Referenced by matches_ipv4().
| bool Botan::GeneralName::matches_ipv6 | ( | const IPv6Address & | ip | ) | const |
Definition at line 208 of file name_constraint.cpp.
References IPv6.
Referenced by matches().
| std::string Botan::GeneralName::name | ( | ) | const |
Definition at line 101 of file name_constraint.cpp.
References BOTAN_ASSERT_UNREACHABLE.
Referenced by botan_x509_general_name_view_string_value(), NameConstraints, and Botan::operator<<().
| std::string Botan::GeneralName::type | ( | ) | const |
Definition at line 34 of file name_constraint.cpp.
References BOTAN_ASSERT_UNREACHABLE, DN, DNS, IPv4, IPv6, Other, RFC822, Unknown, and URI.
Referenced by NameConstraints, and Botan::operator<<().
|
inline |
Definition at line 328 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 65 of file name_constraint.cpp.
References GeneralName(), and uri().
Referenced by GeneralName(), and uri().
|
friend |
Definition at line 361 of file pkix_types.h.
References GeneralName(), name(), NameConstraints, and type().
Referenced by NameConstraints.