Botan
2.1.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 | |
void | decode_from (class BER_Decoder &) override |
void | encode_into (class 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 25 of file name_constraint.h.
enum Botan::GeneralName::MatchResult : int |
Enumerator | |
---|---|
All | |
Some | |
None | |
NotFound | |
UnknownType |
Definition at line 28 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 19 of file name_constraint.cpp.
|
overridevirtual |
Decode whatever this object is from from
from | the BER_Decoder that will be read from |
Implements Botan::ASN1_Object.
Definition at line 39 of file name_constraint.cpp.
References Botan::BER_Object::class_tag, Botan::CONSTRUCTED, Botan::CONTEXT_SPECIFIC, Botan::X509_DN::decode_from(), Botan::BER_Decoder::get_next_object(), Botan::ipv4_to_string(), Botan::LATIN1_CHARSET, Botan::load_be< uint32_t >(), Botan::LOCAL_CHARSET, Botan::ASN1::to_string(), Botan::Charset::transcode(), Botan::BER_Object::type_tag, and Botan::BER_Object::value.
|
overridevirtual |
Encode whatever this object is into to
to | the DER_Encoder that will be written to |
Implements Botan::ASN1_Object.
Definition at line 34 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 103 of file name_constraint.cpp.
References Botan::X509_Certificate::subject_dn(), Botan::X509_Certificate::subject_info(), and type().
|
inline |
Definition at line 60 of file name_constraint.h.
References m_name.
Referenced by Botan::operator<<().
|
inline |
Definition at line 55 of file name_constraint.h.
Referenced by matches(), and Botan::operator<<().