Botan
1.10.9
|
#include <x509_obj.h>
Public Member Functions | |
MemoryVector< byte > | BER_encode () const |
bool | check_signature (class Public_Key &key) const |
bool | check_signature (class Public_Key *key) const |
void | encode (Pipe &out, X509_Encoding encoding=PEM) const |
std::string | hash_used_for_signature () const |
std::string | PEM_encode () const |
MemoryVector< byte > | signature () const |
AlgorithmIdentifier | signature_algorithm () const |
MemoryVector< byte > | tbs_data () const |
virtual | ~X509_Object () |
Static Public Member Functions | |
static MemoryVector< byte > | make_signed (class PK_Signer *signer, RandomNumberGenerator &rng, const AlgorithmIdentifier &alg_id, const MemoryRegion< byte > &tbs) |
Protected Member Functions | |
void | do_decode () |
X509_Object (DataSource &src, const std::string &pem_labels) | |
X509_Object (const std::string &file, const std::string &pem_labels) | |
X509_Object () | |
Protected Attributes | |
MemoryVector< byte > | sig |
AlgorithmIdentifier | sig_algo |
MemoryVector< byte > | tbs_bits |
This class represents abstract X.509 signed objects as in the X.500 SIGNED macro
Definition at line 23 of file x509_obj.h.
|
inlinevirtual |
Definition at line 94 of file x509_obj.h.
|
protected |
Definition at line 24 of file x509_obj.cpp.
|
protected |
Definition at line 32 of file x509_obj.cpp.
|
inlineprotected |
Definition at line 100 of file x509_obj.h.
MemoryVector< byte > Botan::X509_Object::BER_encode | ( | ) | const |
Definition at line 100 of file x509_obj.cpp.
References Botan::BIT_STRING, Botan::DER_Encoder::encode(), Botan::DER_Encoder::end_cons(), Botan::DER_Encoder::get_contents(), Botan::DER_Encoder::raw_bytes(), Botan::SEQUENCE, sig, sig_algo, Botan::DER_Encoder::start_cons(), and tbs_bits.
Referenced by encode(), PEM_encode(), and Botan::CMS_Encoder::sign().
bool Botan::X509_Object::check_signature | ( | class Public_Key & | key | ) | const |
Check the signature on this data
key | the public key purportedly used to sign this data |
Definition at line 178 of file x509_obj.cpp.
References Botan::Public_Key::algo_name(), Botan::DER_SEQUENCE, Botan::IEEE_1363, Botan::OIDS::lookup(), Botan::Public_Key::message_parts(), Botan::AlgorithmIdentifier::oid, sig_algo, signature(), Botan::split_on(), tbs_data(), and Botan::PK_Verifier::verify_message().
Referenced by check_signature().
bool Botan::X509_Object::check_signature | ( | class Public_Key * | key | ) | const |
Check the signature on this data
key | the public key purportedly used to sign this data the pointer will be deleted after use |
Definition at line 169 of file x509_obj.cpp.
References check_signature().
|
protected |
Definition at line 221 of file x509_obj.cpp.
Referenced by Botan::PKCS10_Request::PKCS10_Request(), Botan::X509_Certificate::X509_Certificate(), and Botan::X509_CRL::X509_CRL().
void Botan::X509_Object::encode | ( | Pipe & | out, |
X509_Encoding | encoding = PEM |
||
) | const |
Encode this to a pipe
out | the pipe to write to |
encoding | the encoding to use |
Definition at line 89 of file x509_obj.cpp.
References BER_encode(), Botan::PEM, PEM_encode(), and Botan::Pipe::write().
std::string Botan::X509_Object::hash_used_for_signature | ( | ) | const |
Definition at line 148 of file x509_obj.cpp.
References Botan::OID::as_string(), Botan::OIDS::lookup(), Botan::AlgorithmIdentifier::oid, Botan::parse_algorithm_name(), sig_algo, and Botan::split_on().
|
static |
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 204 of file x509_obj.cpp.
References Botan::BIT_STRING, Botan::DER_Encoder::encode(), Botan::DER_Encoder::get_contents(), Botan::DER_Encoder::raw_bytes(), Botan::SEQUENCE, Botan::PK_Signer::sign_message(), and Botan::DER_Encoder::start_cons().
Referenced by Botan::X509::create_cert_req(), and Botan::X509_CA::make_cert().
std::string Botan::X509_Object::PEM_encode | ( | ) | const |
Definition at line 116 of file x509_obj.cpp.
References BER_encode(), and Botan::PEM_Code::encode().
Referenced by encode().
MemoryVector< byte > Botan::X509_Object::signature | ( | ) | const |
Definition at line 132 of file x509_obj.cpp.
References sig.
Referenced by check_signature().
AlgorithmIdentifier Botan::X509_Object::signature_algorithm | ( | ) | const |
Definition at line 140 of file x509_obj.cpp.
References sig_algo.
Referenced by Botan::X509_Certificate::to_string().
MemoryVector< byte > Botan::X509_Object::tbs_data | ( | ) | const |
The underlying data that is to be or was signed
Definition at line 124 of file x509_obj.cpp.
References Botan::ASN1::put_in_sequence(), and tbs_bits.
Referenced by check_signature().
|
protected |
Definition at line 102 of file x509_obj.h.
Referenced by BER_encode(), Botan::X509_Certificate::operator==(), and signature().
|
protected |
Definition at line 101 of file x509_obj.h.
Referenced by BER_encode(), check_signature(), hash_used_for_signature(), Botan::X509_Certificate::operator==(), and signature_algorithm().
|
protected |
Definition at line 102 of file x509_obj.h.
Referenced by BER_encode(), and tbs_data().