Botan 3.6.1
Crypto and TLS for C&
|
Functions | |
std::vector< uint8_t > | BER_encode (const Public_Key &key) |
std::unique_ptr< Public_Key > | copy_key (const Public_Key &key) |
PKCS10_Request | create_cert_req (const X509_Cert_Options &opts, const Private_Key &key, std::string_view hash_fn, RandomNumberGenerator &rng) |
X509_Certificate | create_self_signed_cert (const X509_Cert_Options &opts, const Private_Key &key, std::string_view hash_fn, RandomNumberGenerator &rng) |
std::unique_ptr< Public_Key > | load_key (const std::vector< uint8_t > &enc) |
std::unique_ptr< Public_Key > | load_key (DataSource &source) |
std::unique_ptr< Public_Key > | load_key (std::span< const uint8_t > enc) |
std::string | PEM_encode (const Public_Key &key) |
|
inline |
BER encode a key
key | the public key to encode |
Definition at line 23 of file x509_key.h.
References Botan::Public_Key::subject_public_key().
Referenced by botan_pubkey_view_der(), create_self_signed_cert(), and Botan::TLS::Certificate_13::Certificate_Entry::serialize().
|
inline |
Copy a key.
key | the public key to copy |
Definition at line 78 of file x509_key.h.
References load_key(), and PEM_encode().
PKCS10_Request Botan::X509::create_cert_req | ( | const X509_Cert_Options & | opts, |
const Private_Key & | key, | ||
std::string_view | hash_fn, | ||
RandomNumberGenerator & | rng ) |
Create a PKCS#10 certificate request.
opts | the options defining the request to create |
key | the key used to sign this request |
rng | the rng to use |
hash_fn | the hash function to use |
Definition at line 123 of file x509self.cpp.
References Botan::Extensions::add_new(), Botan::Key_Constraints::ca_constraints(), Botan::X509_Cert_Options::challenge, Botan::X509_Cert_Options::constraints, Botan::PKCS10_Request::create(), Botan::X509_Cert_Options::extensions, Botan::X509_Cert_Options::is_CA, Botan::X509_Cert_Options::padding_scheme, Botan::X509_Cert_Options::path_limit, and Botan::Extensions::replace().
X509_Certificate Botan::X509::create_self_signed_cert | ( | const X509_Cert_Options & | opts, |
const Private_Key & | key, | ||
std::string_view | hash_fn, | ||
RandomNumberGenerator & | rng ) |
Create a self-signed X.509 certificate.
opts | the options defining the certificate to create |
key | the private key used for signing, i.e. the key associated with this self-signed certificate |
hash_fn | the hash function to use |
rng | the rng to use |
Definition at line 83 of file x509self.cpp.
References Botan::Extensions::add_new(), BER_encode(), BOTAN_ASSERT_NOMSG, Botan::Key_Constraints::ca_constraints(), Botan::X509_Object::choose_sig_format(), Botan::X509_Cert_Options::constraints, Botan::X509_Cert_Options::end, Botan::X509_Cert_Options::ex_constraints, Botan::X509_Cert_Options::extensions, Botan::OID::has_value(), Botan::X509_Cert_Options::is_CA, Botan::X509_CA::make_cert(), Botan::AlgorithmIdentifier::oid(), Botan::X509_Cert_Options::padding_scheme, Botan::X509_Cert_Options::path_limit, Botan::Extensions::replace(), and Botan::X509_Cert_Options::start.
|
inline |
Create a public key from a memory region.
enc | the memory region containing the DER or PEM encoded key |
Definition at line 58 of file x509_key.h.
References load_key().
std::unique_ptr< Public_Key > Botan::X509::load_key | ( | DataSource & | source | ) |
Create a public key from a data source.
source | the source providing the DER or PEM encoded key |
Definition at line 28 of file x509_key.cpp.
References Botan::BitString, Botan::BER_Decoder::decode(), Botan::PEM_Code::decode_check_label(), Botan::BER_Decoder::end_cons(), Botan::load_public_key(), Botan::PEM_Code::matches(), Botan::ASN1::maybe_BER(), and Botan::BER_Decoder::start_sequence().
Referenced by botan_pubkey_load(), Botan::TLS::Certificate_13::Certificate_Entry::Certificate_Entry(), copy_key(), load_key(), load_key(), Botan::TLS::Session::Session(), Botan::PKCS10_Request::subject_public_key(), and Botan::X509_Certificate::subject_public_key().
|
inline |
Create a public key from a memory region.
enc | the memory region containing the DER or PEM encoded key |
Definition at line 68 of file x509_key.h.
References load_key().
std::string Botan::X509::PEM_encode | ( | const Public_Key & | key | ) |
PEM encode a public key into a string.
key | the key to encode |
Definition at line 21 of file x509_key.cpp.
References Botan::PEM_Code::encode(), and Botan::Public_Key::subject_public_key().
Referenced by botan_pubkey_view_pem(), copy_key(), and Botan::X509_Certificate::to_string().