|
Botan
2.13.0
Crypto and TLS for C++11
|
X.509 GeneralName Type. More...
#include <name_constraint.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 28 of file name_constraint.h.
| enum Botan::GeneralName::MatchResult : int |
| Enumerator | |
|---|---|
| All | |
| Some | |
| None | |
| NotFound | |
| UnknownType | |
Definition at line 31 of file name_constraint.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.
References m_name.
|
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 16 of file asn1_obj.cpp.
References Botan::ASN1_Object::encode_into().
Referenced by Botan::PSSR::config_for_x509(), 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 41 of file name_constraint.cpp.
References Botan::BER_Object::bits(), Botan::CONSTRUCTED, Botan::CONTEXT_SPECIFIC, Botan::X509_DN::decode_from(), Botan::BER_Decoder::get_next_object(), Botan::ipv4_to_string(), Botan::BER_Object::is_a(), Botan::BER_Object::length(), Botan::load_be< uint32_t >(), m_name, 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 36 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 95 of file name_constraint.cpp.
References Botan::AlternativeName::get_attribute(), Botan::X509_DN::get_attribute(), Botan::X509_Certificate::subject_alt_name(), Botan::X509_Certificate::subject_dn(), and type().
|
inline |
Definition at line 63 of file name_constraint.h.
References m_name.
Referenced by Botan::operator<<().
|
inline |
Definition at line 58 of file name_constraint.h.
Referenced by matches(), and Botan::operator<<().
1.8.9.1