Botan 3.1.1
Crypto and TLS for C&
|
#include <x509cert.h>
Public Member Functions | |
bool | allowed_extended_usage (const OID &usage) const |
bool | allowed_extended_usage (std::string_view usage) const |
bool | allowed_usage (Key_Constraints usage) const |
bool | allowed_usage (Usage_Type usage) const |
const std::vector< uint8_t > & | authority_key_id () const |
std::vector< uint8_t > | BER_encode () const |
std::vector< std::string > | ca_issuers () const |
const std::vector< OID > & | certificate_policy_oids () const |
bool | check_signature (const Public_Key &key) const |
Key_Constraints | constraints () const |
std::string | crl_distribution_point () const |
void | decode_from (BER_Decoder &from) override |
void | encode_into (DER_Encoder &to) const override |
const std::vector< OID > & | extended_key_usage () const |
std::string | fingerprint (std::string_view hash_name="SHA-1") const |
bool | has_constraints (Key_Constraints constraints) const |
bool | has_ex_constraint (const OID &ex_constraint) const |
bool | has_ex_constraint (std::string_view ex_constraint) const |
bool | is_CA_cert () const |
bool | is_critical (std::string_view ex_name) const |
bool | is_self_signed () const |
bool | is_serial_negative () const |
const AlternativeName & | issuer_alt_name () const |
const X509_DN & | issuer_dn () const |
std::vector< std::string > | issuer_info (std::string_view name) const |
std::unique_ptr< Public_Key > | load_subject_public_key () const |
bool | matches_dns_name (std::string_view name) const |
const NameConstraints & | name_constraints () const |
const X509_Time & | not_after () const |
const X509_Time & | not_before () const |
std::string | ocsp_responder () const |
bool | operator< (const X509_Certificate &other) const |
X509_Certificate & | operator= (const X509_Certificate &other)=default |
bool | operator== (const X509_Certificate &other) const |
uint32_t | path_limit () const |
std::string | PEM_encode () const |
const std::vector< uint8_t > & | raw_issuer_dn () const |
std::vector< uint8_t > | raw_issuer_dn_sha256 () const |
const std::vector< uint8_t > & | raw_subject_dn () const |
std::vector< uint8_t > | raw_subject_dn_sha256 () const |
const std::vector< uint8_t > & | serial_number () const |
const std::vector< uint8_t > & | signature () const |
const AlgorithmIdentifier & | signature_algorithm () const |
const std::vector< uint8_t > & | signed_body () const |
const AlternativeName & | subject_alt_name () const |
const X509_DN & | subject_dn () const |
std::vector< std::string > | subject_info (std::string_view name) const |
const std::vector< uint8_t > & | subject_key_id () const |
std::unique_ptr< Public_Key > | subject_public_key () const |
const AlgorithmIdentifier & | subject_public_key_algo () const |
const std::vector< uint8_t > & | subject_public_key_bits () const |
const std::vector< uint8_t > & | subject_public_key_bitstring () const |
const std::vector< uint8_t > & | subject_public_key_bitstring_sha1 () const |
const std::vector< uint8_t > & | subject_public_key_info () const |
std::vector< uint8_t > | tbs_data () const |
std::string | to_string () const |
const std::vector< uint8_t > & | v2_issuer_key_id () const |
const std::vector< uint8_t > & | v2_subject_key_id () const |
const Extensions & | v3_extensions () const |
std::pair< Certificate_Status_Code, std::string > | verify_signature (const Public_Key &key) const |
X509_Certificate ()=default | |
X509_Certificate (const std::vector< uint8_t > &in) | |
X509_Certificate (const uint8_t data[], size_t length) | |
X509_Certificate (const X509_Certificate &other)=default | |
X509_Certificate (DataSource &source) | |
uint32_t | x509_version () const |
Static Public Member Functions | |
static std::unique_ptr< PK_Signer > | choose_sig_format (const Private_Key &key, RandomNumberGenerator &rng, std::string_view hash_fn, std::string_view padding_algo) |
static std::vector< uint8_t > | make_signed (PK_Signer &signer, RandomNumberGenerator &rng, const AlgorithmIdentifier &alg_id, const secure_vector< uint8_t > &tbs) |
Protected Member Functions | |
void | load_data (DataSource &src) |
This class represents an X.509 Certificate
Definition at line 36 of file x509cert.h.
|
explicit |
Create a certificate from a data source providing the DER or PEM encoded certificate.
source | the data source |
Definition at line 78 of file x509cert.cpp.
References Botan::X509_Object::load_data().
|
explicit |
Create a certificate from a buffer
in | the buffer containing the DER-encoded certificate |
Definition at line 82 of file x509cert.cpp.
References Botan::X509_Object::load_data().
Botan::X509_Certificate::X509_Certificate | ( | const uint8_t | data[], |
size_t | length | ||
) |
Create a certificate from a buffer
data | the buffer containing the DER-encoded certificate |
length | length of data in bytes |
Definition at line 87 of file x509cert.cpp.
References Botan::X509_Object::load_data().
|
default |
Create an uninitialized certificate object. Any attempts to access this object will throw an exception.
|
default |
bool Botan::X509_Certificate::allowed_extended_usage | ( | const OID & | usage | ) | const |
Returns true if the specified usage is set in the extended key usage extension, or if no extended key usage constraints are set at all. To check if a certain extended key constraint is set in the certificate use
Definition at line 426 of file x509cert.cpp.
References extended_key_usage().
bool Botan::X509_Certificate::allowed_extended_usage | ( | std::string_view | usage | ) | const |
Returns true if the specified
usage | is set in the extended key usage extension or if no extended key usage constraints are set at all. To check if a certain extended key constraint is set in the certificate use |
Definition at line 422 of file x509cert.cpp.
References allowed_extended_usage(), and Botan::OID::from_string().
Referenced by allowed_extended_usage(), and allowed_usage().
bool Botan::X509_Certificate::allowed_usage | ( | Key_Constraints | usage | ) | const |
Returns true if the specified
usage | is set in the key usage extension or if no key usage constraints are set at all. To check if a certain key constraint is set in the certificate use |
Definition at line 415 of file x509cert.cpp.
References constraints(), and Botan::Key_Constraints::includes().
Referenced by allowed_usage(), and Botan::PKIX::check_crl().
bool Botan::X509_Certificate::allowed_usage | ( | Usage_Type | usage | ) | const |
Returns true if the required key and extended key constraints are set in the certificate for the specified
usage | or if no key constraints are set in both the key usage and extended key usage extension. |
Definition at line 439 of file x509cert.cpp.
References allowed_extended_usage(), allowed_usage(), Botan::CERTIFICATE_AUTHORITY, Botan::Key_Constraints::DataEncipherment, Botan::Key_Constraints::DigitalSignature, Botan::ENCRYPTION, has_ex_constraint(), is_CA_cert(), Botan::Key_Constraints::KeyAgreement, Botan::Key_Constraints::KeyEncipherment, Botan::Key_Constraints::NonRepudiation, Botan::OCSP_RESPONDER, Botan::TLS_CLIENT_AUTH, Botan::TLS_SERVER_AUTH, and Botan::UNSPECIFIED.
const std::vector< uint8_t > & Botan::X509_Certificate::authority_key_id | ( | ) | const |
Get the DER encoded AuthorityKeyIdentifier of this certificate.
Definition at line 342 of file x509cert.cpp.
Referenced by Botan::PKIX::build_certificate_path(), Botan::Certificate_Store_In_Memory::find_crl_for(), Botan::X509_CRL::is_revoked(), and to_string().
|
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 18 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(), fingerprint(), Botan::Certificate_Store_In_SQL::insert_cert(), Botan::X509_Object::PEM_encode(), and Botan::Certificate_Store_In_SQL::revoke_cert().
std::vector< std::string > Botan::X509_Certificate::ca_issuers | ( | ) | const |
Return the listed addresses of ca issuers, or empty if not set
Definition at line 489 of file x509cert.cpp.
Referenced by to_string().
const std::vector< OID > & Botan::X509_Certificate::certificate_policy_oids | ( | ) | const |
Get the policies as defined in the CertificatePolicies extension of this certificate.
Definition at line 398 of file x509cert.cpp.
Referenced by to_string().
|
inherited |
Check the signature on this data
key | the public key purportedly used to sign this data |
Definition at line 97 of file x509_obj.cpp.
References Botan::VERIFIED, and Botan::X509_Object::verify_signature().
|
staticinherited |
Choose and return a signature scheme appropriate for X.509 signing using the provided parameters.
key | will be the key to choose a padding scheme for |
rng | the random generator to use |
hash_fn | is the desired hash function |
padding_algo | specifies the padding method |
Definition at line 209 of file x509_obj.cpp.
References Botan::Asymmetric_Key::algo_name(), and Botan::Public_Key::default_x509_signature_format().
Referenced by Botan::PKCS10_Request::create(), Botan::X509::create_self_signed_cert(), and Botan::X509_CA::X509_CA().
Key_Constraints Botan::X509_Certificate::constraints | ( | ) | const |
Get the key constraints as defined in the KeyUsage extension of this certificate.
Definition at line 390 of file x509cert.cpp.
Referenced by allowed_usage(), has_constraints(), and to_string().
std::string Botan::X509_Certificate::crl_distribution_point | ( | ) | const |
Return the CRL distribution point, or empty if not set
Definition at line 493 of file x509cert.cpp.
Referenced by Botan::PKIX::check_crl(), and to_string().
|
overridevirtualinherited |
Decode a BER encoded X509_Object See ASN1_Object::decode_from()
Implements Botan::ASN1_Object.
Definition at line 68 of file x509_obj.cpp.
References Botan::BitString, Botan::BER_Decoder::decode(), Botan::BER_Decoder::end_cons(), and Botan::BER_Decoder::start_sequence().
Referenced by Botan::X509_Object::load_data().
|
overridevirtualinherited |
DER encode an X509_Object See ASN1_Object::encode_into()
Implements Botan::ASN1_Object.
Definition at line 55 of file x509_obj.cpp.
References Botan::BitString, Botan::DER_Encoder::encode(), Botan::DER_Encoder::end_cons(), Botan::DER_Encoder::raw_bytes(), Botan::X509_Object::signature(), Botan::X509_Object::signature_algorithm(), Botan::X509_Object::signed_body(), and Botan::DER_Encoder::start_sequence().
const std::vector< OID > & Botan::X509_Certificate::extended_key_usage | ( | ) | const |
Get the key usage as defined in the ExtendedKeyUsage extension of this certificate, or else an empty vector.
Definition at line 394 of file x509cert.cpp.
Referenced by allowed_extended_usage(), has_ex_constraint(), and to_string().
std::string Botan::X509_Certificate::fingerprint | ( | std::string_view | hash_name = "SHA-1" | ) | const |
hash_name | hash function used to calculate the fingerprint |
Definition at line 572 of file x509cert.cpp.
References Botan::ASN1_Object::BER_encode(), and Botan::create_hex_fingerprint().
Referenced by Botan::Certificate_Store_In_SQL::affirm_cert(), Botan::PKIX::build_certificate_path(), Botan::Certificate_Store_In_SQL::find_key(), Botan::Certificate_Store_In_SQL::insert_cert(), Botan::Certificate_Store_In_SQL::insert_key(), Botan::Certificate_Store_In_SQL::remove_cert(), and Botan::Certificate_Store_In_SQL::revoke_cert().
bool Botan::X509_Certificate::has_constraints | ( | Key_Constraints | constraints | ) | const |
Returns true if and only if the specified
constraints | are included in the key usage extension. |
Typically for applications you want allowed_usage instead.
Definition at line 410 of file x509cert.cpp.
References constraints(), and Botan::Key_Constraints::includes().
bool Botan::X509_Certificate::has_ex_constraint | ( | const OID & | ex_constraint | ) | const |
Returns true if and only if OID
ex_constraint | is included in the extended key extension. |
Definition at line 473 of file x509cert.cpp.
References extended_key_usage().
bool Botan::X509_Certificate::has_ex_constraint | ( | std::string_view | ex_constraint | ) | const |
Returns true if and only if OID
ex_constraint | is included in the extended key extension. |
Definition at line 469 of file x509cert.cpp.
References Botan::OID::from_string(), and has_ex_constraint().
Referenced by allowed_usage(), and has_ex_constraint().
bool Botan::X509_Certificate::is_CA_cert | ( | ) | const |
Check whether this certificate is a CA certificate.
Definition at line 374 of file x509cert.cpp.
Referenced by allowed_usage(), Botan::PKIX::check_chain(), Botan::Flatfile_Certificate_Store::Flatfile_Certificate_Store(), Botan::Cert_Extension::Name_Constraints::validate(), and Botan::X509_CA::X509_CA().
bool Botan::X509_Certificate::is_critical | ( | std::string_view | ex_name | ) | const |
Check whenever a given X509 Extension is marked critical in this certificate.
Definition at line 481 of file x509cert.cpp.
References Botan::Extensions::critical_extension_set(), Botan::OID::from_string(), and v3_extensions().
Referenced by Botan::Cert_Extension::Name_Constraints::validate().
bool Botan::X509_Certificate::is_self_signed | ( | ) | const |
Check whether this certificate is self signed. If the DN issuer and subject agree,
Definition at line 298 of file x509cert.cpp.
Referenced by Botan::PKIX::build_certificate_path(), Botan::PKIX::check_chain(), and Botan::Flatfile_Certificate_Store::Flatfile_Certificate_Store().
bool Botan::X509_Certificate::is_serial_negative | ( | ) | const |
Get the serial number's sign
Definition at line 354 of file x509cert.cpp.
Referenced by Botan::PKIX::check_chain().
const AlternativeName & Botan::X509_Certificate::issuer_alt_name | ( | ) | const |
Return the issuer alternative names (DNS, IP, ...)
Definition at line 505 of file x509cert.cpp.
Referenced by issuer_info().
const X509_DN & Botan::X509_Certificate::issuer_dn | ( | ) | const |
Get the certificate's issuer distinguished name (DN).
Definition at line 358 of file x509cert.cpp.
Referenced by Botan::PKIX::build_certificate_path(), Botan::PKIX::check_chain(), Botan::Certificate_Store_In_SQL::find_crl_for(), Botan::Certificate_Store_In_Memory::find_crl_for(), Botan::X509_CRL::is_revoked(), issuer_info(), Botan::OCSP::Request::Request(), and to_string().
std::vector< std::string > Botan::X509_Certificate::issuer_info | ( | std::string_view | name | ) | const |
Get a value for a specific subject_info parameter name.
name | the name of the parameter to look up. Possible names are "X509.Certificate.v2.key_id" or "X509v3.AuthorityKeyIdentifier". |
Definition at line 531 of file x509cert.cpp.
References Botan::X509_DN::get_attribute(), Botan::AlternativeName::get_attribute(), issuer_alt_name(), and issuer_dn().
|
protectedinherited |
Decodes from src as either DER or PEM data, then calls force_decode()
Definition at line 24 of file x509_obj.cpp.
References Botan::X509_Object::alternate_PEM_labels(), Botan::PEM_Code::decode(), Botan::X509_Object::decode_from(), Botan::PEM_Code::matches(), Botan::ASN1::maybe_BER(), and Botan::X509_Object::PEM_label().
Referenced by Botan::PKCS10_Request::PKCS10_Request(), X509_Certificate(), and Botan::X509_CRL::X509_CRL().
std::unique_ptr< Public_Key > Botan::X509_Certificate::load_subject_public_key | ( | ) | const |
Create a public key object associated with the public key bits in this certificate. If the public key bits was valid for X.509 encoding purposes but invalid algorithmically (for example, RSA with an even modulus) that will be detected at this point, and an exception will be thrown.
Definition at line 554 of file x509cert.cpp.
References subject_public_key().
|
staticinherited |
Create a signed X509 object.
signer | the signer used to sign the object |
rng | the random number generator to use |
alg_id | the algorithm identifier of the signature scheme |
tbs | the tbs bits to be signed |
Definition at line 125 of file x509_obj.cpp.
References Botan::BitString, Botan::DER_Encoder::encode(), Botan::DER_Encoder::end_cons(), Botan::DER_Encoder::raw_bytes(), Botan::PK_Signer::sign_message(), Botan::X509_Object::signature(), and Botan::DER_Encoder::start_sequence().
Referenced by Botan::PKCS10_Request::create(), and Botan::X509_CA::make_cert().
bool Botan::X509_Certificate::matches_dns_name | ( | std::string_view | name | ) | const |
Check if a certain DNS name matches up with the information in the cert
name | DNS name to match |
Definition at line 591 of file x509cert.cpp.
References Botan::host_wildcard_match(), name, and subject_info().
const NameConstraints & Botan::X509_Certificate::name_constraints | ( | ) | const |
Get the name constraints as defined in the NameConstraints extension of this certificate.
Definition at line 402 of file x509cert.cpp.
Referenced by to_string().
const X509_Time & Botan::X509_Certificate::not_after | ( | ) | const |
Get the notAfter of the certificate as X509_Time
Definition at line 306 of file x509cert.cpp.
Referenced by Botan::PKIX::check_chain(), and to_string().
const X509_Time & Botan::X509_Certificate::not_before | ( | ) | const |
Get the notBefore of the certificate as X509_Time
Definition at line 302 of file x509cert.cpp.
Referenced by Botan::PKIX::check_chain(), and to_string().
std::string Botan::X509_Certificate::ocsp_responder | ( | ) | const |
Return the listed address of an OCSP responder, or empty if not set
Definition at line 485 of file x509cert.cpp.
Referenced by to_string().
bool Botan::X509_Certificate::operator< | ( | const X509_Certificate & | other | ) | const |
Impose an arbitrary (but consistent) ordering, eg to allow sorting a container of certificate objects.
Definition at line 620 of file x509cert.cpp.
References Botan::X509_Object::signature(), and Botan::X509_Object::signed_body().
|
default |
bool Botan::X509_Certificate::operator== | ( | const X509_Certificate & | other | ) | const |
Check to certificates for equality.
Definition at line 615 of file x509cert.cpp.
References Botan::X509_Object::signature(), Botan::X509_Object::signature_algorithm(), and Botan::X509_Object::signed_body().
uint32_t Botan::X509_Certificate::path_limit | ( | ) | const |
Get the path limit as defined in the BasicConstraints extension of this certificate.
Definition at line 382 of file x509cert.cpp.
Referenced by Botan::PKIX::check_chain().
|
inherited |
Definition at line 83 of file x509_obj.cpp.
References Botan::ASN1_Object::BER_encode(), Botan::PEM_Code::encode(), and Botan::X509_Object::PEM_label().
const std::vector< uint8_t > & Botan::X509_Certificate::raw_issuer_dn | ( | ) | const |
Raw issuer DN bits
Definition at line 366 of file x509cert.cpp.
Referenced by Botan::OCSP::CertID::is_id_for().
std::vector< uint8_t > Botan::X509_Certificate::raw_issuer_dn_sha256 | ( | ) | const |
SHA-256 of Raw issuer DN
Definition at line 558 of file x509cert.cpp.
const std::vector< uint8_t > & Botan::X509_Certificate::raw_subject_dn | ( | ) | const |
Raw subject DN
Definition at line 370 of file x509cert.cpp.
Referenced by Botan::OCSP::CertID::CertID().
std::vector< uint8_t > Botan::X509_Certificate::raw_subject_dn_sha256 | ( | ) | const |
SHA-256 of Raw subject DN
Definition at line 565 of file x509cert.cpp.
Referenced by Botan::Flatfile_Certificate_Store::Flatfile_Certificate_Store().
const std::vector< uint8_t > & Botan::X509_Certificate::serial_number | ( | ) | const |
Get the serial number of this certificate.
Definition at line 350 of file x509cert.cpp.
Referenced by Botan::CRL_Entry::CRL_Entry(), Botan::OCSP::CertID::is_id_for(), Botan::X509_CRL::is_revoked(), and to_string().
|
inlineinherited |
Definition at line 37 of file x509_obj.h.
Referenced by Botan::X509_Object::encode_into(), Botan::X509_Object::make_signed(), operator<(), operator==(), and Botan::X509_Object::verify_signature().
|
inlineinherited |
Definition at line 47 of file x509_obj.h.
Referenced by Botan::PKIX::check_chain(), Botan::X509_Object::encode_into(), operator==(), to_string(), and Botan::X509_Object::verify_signature().
|
inlineinherited |
Definition at line 42 of file x509_obj.h.
Referenced by Botan::X509_Object::encode_into(), operator<(), and operator==().
const AlternativeName & Botan::X509_Certificate::subject_alt_name | ( | ) | const |
Return the subject alternative names (DNS, IP, ...)
Definition at line 501 of file x509cert.cpp.
Referenced by Botan::GeneralName::matches(), and subject_info().
const X509_DN & Botan::X509_Certificate::subject_dn | ( | ) | const |
Get the certificate's subject distinguished name (DN).
Definition at line 362 of file x509cert.cpp.
Referenced by Botan::Certificate_Store::certificate_known(), Botan::PKIX::check_chain(), Botan::Flatfile_Certificate_Store::Flatfile_Certificate_Store(), Botan::Certificate_Store_In_SQL::insert_cert(), Botan::GeneralName::matches(), Botan::Certificate_Store_In_SQL::remove_cert(), Botan::OCSP::Request::Request(), subject_info(), and to_string().
std::vector< std::string > Botan::X509_Certificate::subject_info | ( | std::string_view | name | ) | const |
Get a value for a specific subject_info parameter name.
name | the name of the parameter to look up. Possible names include "X509.Certificate.version", "X509.Certificate.serial", "X509.Certificate.start", "X509.Certificate.end", "X509.Certificate.v2.key_id", "X509.Certificate.public_key", "X509v3.BasicConstraints.path_constraint", "X509v3.BasicConstraints.is_ca", "X509v3.NameConstraints", "X509v3.ExtendedKeyUsage", "X509v3.CertificatePolicies", "X509v3.SubjectKeyIdentifier", "X509.Certificate.serial", "X520.CommonName", "X520.Organization", "X520.Country", "RFC822" (Email in SAN) or "PKCS9.EmailAddress" (Email in DN). |
Definition at line 512 of file x509cert.cpp.
References Botan::X509_DN::get_attribute(), Botan::AlternativeName::get_attribute(), subject_alt_name(), subject_dn(), and subject_info().
Referenced by matches_dns_name(), and subject_info().
const std::vector< uint8_t > & Botan::X509_Certificate::subject_key_id | ( | ) | const |
Get the DER encoded SubjectKeyIdentifier of this certificate.
Definition at line 346 of file x509cert.cpp.
Referenced by Botan::Certificate_Store::certificate_known(), Botan::X509_CA::choose_extensions(), Botan::Certificate_Store_In_SQL::insert_cert(), Botan::Certificate_Store_In_SQL::remove_cert(), and to_string().
std::unique_ptr< Public_Key > Botan::X509_Certificate::subject_public_key | ( | ) | const |
Create a public key object associated with the public key bits in this certificate. If the public key bits was valid for X.509 encoding purposes but invalid algorithmically (for example, RSA with an even modulus) that will be detected at this point, and an exception will be thrown.
Definition at line 546 of file x509cert.cpp.
References Botan::X509::load_key(), and subject_public_key_info().
Referenced by Botan::PKIX::check_chain(), Botan::PKIX::check_crl(), load_subject_public_key(), to_string(), Botan::TLS::Certificate_Verify_12::verify(), and Botan::OCSP::Response::verify_signature().
const AlgorithmIdentifier & Botan::X509_Certificate::subject_public_key_algo | ( | ) | const |
Return the algorithm identifier of the public key
Definition at line 310 of file x509cert.cpp.
Referenced by to_string().
const std::vector< uint8_t > & Botan::X509_Certificate::subject_public_key_bits | ( | ) | const |
Get the public key associated with this certificate. This includes the outer AlgorithmIdentifier
Definition at line 322 of file x509cert.cpp.
const std::vector< uint8_t > & Botan::X509_Certificate::subject_public_key_bitstring | ( | ) | const |
Get the bit string of the public key associated with this certificate
Definition at line 330 of file x509cert.cpp.
Referenced by Botan::OCSP::CertID::CertID(), and Botan::OCSP::CertID::is_id_for().
const std::vector< uint8_t > & Botan::X509_Certificate::subject_public_key_bitstring_sha1 | ( | ) | const |
Get the SHA-1 bit string of the public key associated with this certificate. This is used for OCSP among other protocols. This function will throw if SHA-1 is not available.
Definition at line 334 of file x509cert.cpp.
Referenced by Botan::Flatfile_Certificate_Store::Flatfile_Certificate_Store().
const std::vector< uint8_t > & Botan::X509_Certificate::subject_public_key_info | ( | ) | const |
Get the SubjectPublicKeyInfo associated with this certificate.
Definition at line 326 of file x509cert.cpp.
Referenced by subject_public_key().
|
inherited |
The underlying data that is to be or was signed
Definition at line 90 of file x509_obj.cpp.
References Botan::ASN1::put_in_sequence().
Referenced by Botan::X509_Object::verify_signature().
std::string Botan::X509_Certificate::to_string | ( | ) | const |
Definition at line 637 of file x509cert.cpp.
References authority_key_id(), ca_issuers(), certificate_policy_oids(), constraints(), crl_distribution_point(), Botan::Key_Constraints::CrlSign, Botan::Key_Constraints::DataEncipherment, Botan::Key_Constraints::DecipherOnly, Botan::Key_Constraints::DigitalSignature, Botan::Key_Constraints::empty(), Botan::Key_Constraints::EncipherOnly, Botan::NameConstraints::excluded(), extended_key_usage(), Botan::hex_encode(), Botan::Key_Constraints::includes(), issuer_dn(), Botan::Key_Constraints::KeyAgreement, Botan::Key_Constraints::KeyCertSign, Botan::Key_Constraints::KeyEncipherment, name_constraints(), Botan::Key_Constraints::NonRepudiation, not_after(), not_before(), ocsp_responder(), Botan::AlgorithmIdentifier::oid(), Botan::X509::PEM_encode(), Botan::NameConstraints::permitted(), Botan::ASN1_Time::readable_string(), serial_number(), Botan::X509_Object::signature_algorithm(), subject_dn(), subject_key_id(), subject_public_key(), subject_public_key_algo(), Botan::OID::to_formatted_string(), Botan::OID::to_string(), and x509_version().
const std::vector< uint8_t > & Botan::X509_Certificate::v2_issuer_key_id | ( | ) | const |
Return the v2 issuer key ID. v2 key IDs are almost never used, instead see v3_subject_key_id.
Definition at line 314 of file x509cert.cpp.
Referenced by Botan::PKIX::check_chain().
const std::vector< uint8_t > & Botan::X509_Certificate::v2_subject_key_id | ( | ) | const |
Return the v2 subject key ID. v2 key IDs are almost never used, instead see v3_subject_key_id.
Definition at line 318 of file x509cert.cpp.
Referenced by Botan::PKIX::check_chain().
const Extensions & Botan::X509_Certificate::v3_extensions | ( | ) | const |
Get all extensions of this certificate.
Definition at line 406 of file x509cert.cpp.
Referenced by Botan::PKIX::check_chain(), and is_critical().
|
inherited |
Check the signature on this data
key | the public key purportedly used to sign this data |
Definition at line 102 of file x509_obj.cpp.
References Botan::PK_Verifier::hash_function(), Botan::X509_Object::signature(), Botan::SIGNATURE_ALGO_BAD_PARAMS, Botan::SIGNATURE_ALGO_UNKNOWN, Botan::X509_Object::signature_algorithm(), Botan::SIGNATURE_ERROR, Botan::X509_Object::tbs_data(), Botan::VERIFIED, and Botan::PK_Verifier::verify_message().
Referenced by Botan::PKIX::check_chain(), and Botan::X509_Object::check_signature().
uint32_t Botan::X509_Certificate::x509_version | ( | ) | const |
Get the X509 version of this certificate object.
Definition at line 294 of file x509cert.cpp.
Referenced by Botan::PKIX::check_chain(), and to_string().