|
Botan
2.13.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
| 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(), and create_self_signed_cert().
| 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().
| 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 109 of file x509self.cpp.
References Botan::Extensions::add_new(), Botan::X509_Cert_Options::challenge, Botan::X509_Cert_Options::constraints, Botan::PKCS10_Request::create(), Botan::CRL_SIGN, Botan::X509_Cert_Options::ex_constraints, Botan::X509_Cert_Options::extensions, Botan::X509_Cert_Options::is_CA, Botan::KEY_CERT_SIGN, Botan::NO_CONSTRAINTS, Botan::X509_Cert_Options::padding_scheme, Botan::X509_Cert_Options::path_limit, and Botan::verify_cert_constraints_valid_for_key_type().
| 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 50 of file x509self.cpp.
References Botan::Extensions::add_new(), BER_encode(), BOTAN_ASSERT_NOMSG, 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::AlgorithmIdentifier::get_oid(), Botan::OID::has_value(), Botan::X509_Cert_Options::is_CA, Botan::KEY_CERT_SIGN, Botan::X509_CA::make_cert(), Botan::NO_CONSTRAINTS, Botan::X509_Cert_Options::padding_scheme, Botan::X509_Cert_Options::path_limit, Botan::X509_Cert_Options::start, and Botan::verify_cert_constraints_valid_for_key_type().
| 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, and Botan::BER_Decoder::start_cons().
Referenced by botan_privkey_export_pubkey(), botan_pubkey_load(), copy_key(), load_key(), Botan::X509_Certificate::load_subject_public_key(), and Botan::PKCS10_Request::subject_public_key().
| 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().
| 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().
1.8.9.1