Botan 3.6.1
Crypto and TLS for C&
|
X.509 GeneralName Type. More...
#include <pkix_types.h>
Public Types | |
enum | MatchResult : int { 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 |
void | decode_from (BER_Decoder &) override |
void | encode_into (DER_Encoder &) 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 |
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 Contraints).
This entire class is deprecated and will be removed in a future major release
Definition at line 251 of file pkix_types.h.
enum Botan::GeneralName::MatchResult : int |
Enumerator | |
---|---|
All | |
Some | |
None | |
NotFound | |
UnknownType |
Definition at line 253 of file pkix_types.h.
|
strong |
|
default |
|
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().
|
overridevirtual |
Decode whatever this object is from from
from | the BER_Decoder that will be read from |
Implements Botan::ASN1_Object.
Definition at line 68 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(), Botan::tolower_string(), Unknown, and URI.
|
overridevirtual |
Encode whatever this object is into to
to | the DER_Encoder that will be written to |
Implements Botan::ASN1_Object.
Definition at line 64 of file name_constraint.cpp.
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 132 of file name_constraint.cpp.
References Botan::AlternativeName::count(), Botan::AlternativeName::directory_names(), DN, DNS, Botan::AlternativeName::dns(), final, Botan::X509_DN::get_attribute(), IPv4, Botan::AlternativeName::ipv4_address(), matches_dn(), matches_dns(), 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 124 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 108 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 116 of file name_constraint.cpp.
References IPv4.
std::string Botan::GeneralName::name | ( | ) | const |
Definition at line 45 of file name_constraint.cpp.
References BOTAN_ASSERT_UNREACHABLE, Botan::fmt(), and Botan::ipv4_to_string().
Referenced by Botan::operator<<().
std::string Botan::GeneralName::type | ( | ) | const |
Definition at line 24 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 281 of file pkix_types.h.