Botan
2.1.0
Crypto and TLS for C++11
|
Functions | |
std::vector< uint8_t > | BER_encode (const Public_Key &key) |
Public_Key * | copy_key (const Public_Key &key) |
PKCS10_Request | create_cert_req (const X509_Cert_Options &opts, const Private_Key &key, const std::string &hash_fn, RandomNumberGenerator &rng) |
X509_Certificate | create_self_signed_cert (const X509_Cert_Options &opts, const Private_Key &key, const std::string &hash_fn, RandomNumberGenerator &rng) |
Public_Key * | load_key (DataSource &source) |
Public_Key * | load_key (const std::vector< uint8_t > &mem) |
std::string | PEM_encode (const Public_Key &key) |
This namespace contains functions for handling X.509 public keys
BOTAN_DLL std::vector< uint8_t > Botan::X509::BER_encode | ( | const Public_Key & | key | ) |
BER encode a key
key | the public key to encode |
Definition at line 19 of file x509_key.cpp.
References Botan::Public_Key::subject_public_key().
Referenced by botan_privkey_export_pubkey(), botan_pubkey_export(), create_cert_req(), and create_self_signed_cert().
BOTAN_DLL Public_Key * Botan::X509::copy_key | ( | const Public_Key & | key | ) |
Copy a key.
key | the public key to copy |
Definition at line 98 of file x509_key.cpp.
References load_key(), and PEM_encode().
BOTAN_DLL PKCS10_Request Botan::X509::create_cert_req | ( | const X509_Cert_Options & | opts, |
const Private_Key & | key, | ||
const std::string & | 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 96 of file x509self.cpp.
References Botan::Extensions::add(), BER_encode(), Botan::X509_Cert_Options::challenge, Botan::choose_sig_format(), Botan::X509_Cert_Options::constraints, Botan::CRL_SIGN, Botan::DIRECTORY_STRING, Botan::DER_Encoder::encode(), Botan::PEM_Code::encode(), Botan::DER_Encoder::end_cons(), Botan::DER_Encoder::end_explicit(), Botan::X509_Cert_Options::ex_constraints, Botan::X509_Cert_Options::extensions, Botan::DER_Encoder::get_contents(), Botan::X509_Cert_Options::is_CA, Botan::KEY_CERT_SIGN, Botan::X509_Object::make_signed(), Botan::NO_CONSTRAINTS, Botan::X509_Cert_Options::path_limit, Botan::DER_Encoder::raw_bytes(), Botan::SEQUENCE, Botan::DER_Encoder::start_cons(), Botan::DER_Encoder::start_explicit(), and Botan::verify_cert_constraints_valid_for_key_type().
BOTAN_DLL X509_Certificate Botan::X509::create_self_signed_cert | ( | const X509_Cert_Options & | opts, |
const Private_Key & | key, | ||
const std::string & | 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 44 of file x509self.cpp.
References Botan::Extensions::add(), BER_encode(), Botan::choose_sig_format(), Botan::X509_Cert_Options::constraints, Botan::CRL_SIGN, Botan::X509_Cert_Options::end, Botan::X509_Cert_Options::ex_constraints, Botan::X509_Cert_Options::extensions, Botan::X509_Cert_Options::is_CA, Botan::KEY_CERT_SIGN, Botan::X509_CA::make_cert(), Botan::NO_CONSTRAINTS, Botan::X509_Cert_Options::path_limit, Botan::X509_Cert_Options::start, and Botan::verify_cert_constraints_valid_for_key_type().
BOTAN_DLL 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 37 of file x509_key.cpp.
References Botan::BIT_STRING, 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(), Botan::SEQUENCE, Botan::BER_Decoder::start_cons(), and Botan::Exception::what().
Referenced by botan_privkey_export_pubkey(), botan_pubkey_load(), copy_key(), load_key(), Botan::PKCS10_Request::subject_public_key(), and Botan::X509_Certificate::subject_public_key().
BOTAN_DLL Public_Key * Botan::X509::load_key | ( | const std::vector< uint8_t > & | enc | ) |
Create a public key from a memory region.
enc | the memory region containing the DER or PEM encoded key |
Definition at line 89 of file x509_key.cpp.
References load_key().
BOTAN_DLL 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 28 of file x509_key.cpp.
References Botan::PEM_Code::encode(), and Botan::Public_Key::subject_public_key().
Referenced by botan_pubkey_export(), copy_key(), and Botan::X509_Certificate::to_string().