Botan 3.6.1
Crypto and TLS for C&
|
#include <pkcs10.h>
Public Member Functions | |
std::vector< uint8_t > | BER_encode () const |
std::string | challenge_password () const |
bool | check_signature (const Public_Key &key) const |
Key_Constraints | constraints () const |
void | decode_from (BER_Decoder &from) override |
void | encode_into (DER_Encoder &to) const override |
std::vector< OID > | ex_constraints () const |
const Extensions & | extensions () const |
bool | is_CA () const |
size_t | path_limit () const |
std::string | PEM_encode () const |
PKCS10_Request (const std::vector< uint8_t > &vec) | |
PKCS10_Request (DataSource &source) | |
const std::vector< uint8_t > & | raw_public_key () 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::unique_ptr< Public_Key > | subject_public_key () const |
std::vector< uint8_t > | tbs_data () const |
std::pair< Certificate_Status_Code, std::string > | verify_signature (const Public_Key &key) 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 PKCS10_Request | create (const Private_Key &key, const X509_DN &subject_dn, const Extensions &extensions, std::string_view hash_fn, RandomNumberGenerator &rng, std::string_view padding_scheme="", std::string_view challenge="") |
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) |
|
explicit |
Create a PKCS#10 Request from a data source.
source | the data source providing the DER encoded request |
Definition at line 36 of file pkcs10.cpp.
References Botan::X509_Object::load_data().
Referenced by create().
|
explicit |
Create a PKCS#10 Request from binary data.
vec | a std::vector containing the DER value |
Definition at line 40 of file pkcs10.cpp.
References Botan::X509_Object::load_data().
|
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 19 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(), Botan::X509_Certificate::fingerprint(), Botan::Certificate_Store_In_SQL::insert_cert(), Botan::X509_Object::PEM_encode(), and Botan::Certificate_Store_In_SQL::revoke_cert().
std::string Botan::PKCS10_Request::challenge_password | ( | ) | const |
Get the challenge password for this request
Definition at line 182 of file pkcs10.cpp.
|
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 create(), Botan::X509::create_self_signed_cert(), and Botan::X509_CA::X509_CA().
Key_Constraints Botan::PKCS10_Request::constraints | ( | ) | const |
Get the key constraints for the key associated with this PKCS#10 object.
Definition at line 225 of file pkcs10.cpp.
References extensions(), Botan::OID::from_string(), Botan::Cert_Extension::Key_Usage::get_constraints(), and Botan::Key_Constraints::None.
Referenced by Botan::X509_CA::choose_extensions().
|
static |
Create a new PKCS10 certificate request
key | the key that will be included in the certificate request |
subject_dn | the DN to be placed in the request |
extensions | extensions to include in the request |
hash_fn | the hash function to use to create the signature |
rng | a random number generator |
padding_scheme | if set specifies the padding scheme, otherwise an algorithm-specific default is used. |
challenge | a challenge string to be included in the PKCS10 request, sometimes used for revocation purposes. |
Definition at line 53 of file pkcs10.cpp.
References Botan::X509_Object::choose_sig_format(), Botan::DER_Encoder::encode(), Botan::DER_Encoder::end_cons(), Botan::DER_Encoder::end_explicit(), extensions(), Botan::DER_Encoder::get_contents(), Botan::X509_Object::make_signed(), PKCS10_Request(), Botan::DER_Encoder::raw_bytes(), Botan::DER_Encoder::start_explicit(), Botan::DER_Encoder::start_sequence(), subject_dn(), and Botan::Public_Key::subject_public_key().
Referenced by Botan::X509::create_cert_req().
|
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(), Botan::BER_Decoder::raw_bytes(), 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().
std::vector< OID > Botan::PKCS10_Request::ex_constraints | ( | ) | const |
Get the extendend key constraints (if any).
Definition at line 236 of file pkcs10.cpp.
References extensions(), Botan::OID::from_string(), and Botan::Cert_Extension::Extended_Key_Usage::object_identifiers().
Referenced by Botan::X509_CA::choose_extensions().
const Extensions & Botan::PKCS10_Request::extensions | ( | ) | const |
Get the X509v3 extensions.
Definition at line 218 of file pkcs10.cpp.
Referenced by Botan::X509_CA::choose_extensions(), constraints(), create(), ex_constraints(), is_CA(), and path_limit().
bool Botan::PKCS10_Request::is_CA | ( | ) | const |
Find out whether this is a CA request.
Definition at line 247 of file pkcs10.cpp.
References extensions(), Botan::OID::from_string(), and Botan::Cert_Extension::Basic_Constraints::get_is_ca().
Referenced by Botan::X509_CA::choose_extensions().
|
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 PKCS10_Request(), PKCS10_Request(), Botan::X509_Certificate::X509_Certificate(), Botan::X509_Certificate::X509_Certificate(), Botan::X509_Certificate::X509_Certificate(), Botan::X509_CRL::X509_CRL(), and Botan::X509_CRL::X509_CRL().
|
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 create(), and Botan::X509_CA::make_cert().
size_t Botan::PKCS10_Request::path_limit | ( | ) | const |
Return the constraint on the path length defined in the BasicConstraints extension.
Definition at line 258 of file pkcs10.cpp.
References extensions(), Botan::OID::from_string(), Botan::Cert_Extension::Basic_Constraints::get_is_ca(), and Botan::Cert_Extension::Basic_Constraints::get_path_limit().
Referenced by Botan::X509_CA::choose_extensions().
|
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::PKCS10_Request::raw_public_key | ( | ) | const |
Get the raw DER encoded public key.
Definition at line 196 of file pkcs10.cpp.
Referenced by Botan::X509_CA::choose_extensions(), Botan::X509_CA::sign_request(), Botan::X509_CA::sign_request(), and subject_public_key().
|
inlineinherited |
Definition at line 37 of file x509_obj.h.
Referenced by Botan::X509_Object::encode_into(), Botan::X509_Object::make_signed(), Botan::X509_Certificate::operator<(), Botan::X509_Certificate::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(), Botan::X509_Certificate::operator==(), Botan::X509_Certificate::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(), Botan::X509_Certificate::operator<(), and Botan::X509_Certificate::operator==().
const AlternativeName & Botan::PKCS10_Request::subject_alt_name | ( | ) | const |
Get the subject alternative name.
Definition at line 211 of file pkcs10.cpp.
Referenced by Botan::X509_CA::choose_extensions().
const X509_DN & Botan::PKCS10_Request::subject_dn | ( | ) | const |
Get the subject DN.
Definition at line 189 of file pkcs10.cpp.
Referenced by create(), Botan::X509_CA::sign_request(), and Botan::X509_CA::sign_request().
std::unique_ptr< Public_Key > Botan::PKCS10_Request::subject_public_key | ( | ) | const |
Get the subject public key.
Definition at line 203 of file pkcs10.cpp.
References Botan::X509::load_key(), and raw_public_key().
Referenced by Botan::X509_CA::choose_extensions().
|
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().
|
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().