Botan 3.3.0
Crypto and TLS for C&
|
X.509 GeneralName Type. More...
#include <pkix_types.h>
Public Types | |
enum | MatchResult : int { All , Some , None , NotFound , UnknownType } |
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 | |
GeneralName (const std::string &str) | |
MatchResult | matches (const X509_Certificate &cert) const |
const std::string & | name () const |
const std::string & | type () 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).
Definition at line 181 of file pkix_types.h.
enum Botan::GeneralName::MatchResult : int |
Enumerator | |
---|---|
All | |
Some | |
None | |
NotFound | |
UnknownType |
Definition at line 183 of file pkix_types.h.
|
default |
Creates an empty GeneralName.
Botan::GeneralName::GeneralName | ( | const std::string & | str | ) |
Creates a new GeneralName for its string format.
str | type and name, colon-separated, e.g., "DNS:google.com" |
Definition at line 21 of file name_constraint.cpp.
|
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 36 of file name_constraint.cpp.
References Botan::BER_Object::bits(), Botan::Constructed, Botan::ContextSpecific, Botan::X509_DN::decode_from(), Botan::BER_Decoder::get_next_object(), Botan::ipv4_to_string(), Botan::BER_Object::is_a(), Botan::BER_Object::length(), and Botan::ASN1::to_string().
|
overridevirtual |
Encode whatever this object is into to
to | the DER_Encoder that will be written to |
Implements Botan::ASN1_Object.
Definition at line 32 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 73 of file name_constraint.cpp.
References All, Botan::AlternativeName::dn(), Botan::X509_DN::get_attribute(), Botan::AlternativeName::get_attribute(), None, NotFound, Some, Botan::X509_Certificate::subject_alt_name(), Botan::X509_Certificate::subject_dn(), Botan::X509_DN::to_string(), type(), and UnknownType.
|
inline |
Definition at line 214 of file pkix_types.h.
Referenced by Botan::operator<<().
|
inline |
Definition at line 209 of file pkix_types.h.
Referenced by matches(), and Botan::operator<<().