Botan
1.10.9
|
#include <if_algo.h>
Public Member Functions | |
virtual std::string | algo_name () const =0 |
AlgorithmIdentifier | algorithm_identifier () const |
bool | check_key (RandomNumberGenerator &rng, bool) const |
const BigInt & | get_c () const |
const BigInt & | get_d () const |
const BigInt & | get_d1 () const |
const BigInt & | get_d2 () const |
const BigInt & | get_e () const |
const BigInt & | get_n () const |
virtual OID | get_oid () const |
const BigInt & | get_p () const |
const BigInt & | get_q () const |
IF_Scheme_PrivateKey (RandomNumberGenerator &rng, const BigInt &prime1, const BigInt &prime2, const BigInt &exp, const BigInt &d_exp, const BigInt &mod) | |
IF_Scheme_PrivateKey (RandomNumberGenerator &rng, const AlgorithmIdentifier &alg_id, const MemoryRegion< byte > &key_bits) | |
size_t | max_input_bits () const |
virtual size_t | message_part_size () const |
virtual size_t | message_parts () const |
virtual AlgorithmIdentifier | pkcs8_algorithm_identifier () const |
MemoryVector< byte > | pkcs8_private_key () const |
MemoryVector< byte > | x509_subject_public_key () const |
Protected Member Functions | |
void | gen_check (RandomNumberGenerator &rng) const |
IF_Scheme_PrivateKey () | |
virtual void | load_check (RandomNumberGenerator &rng) const |
void | load_check (RandomNumberGenerator &rng) const |
Protected Attributes | |
BigInt | c |
BigInt | d |
BigInt | d1 |
BigInt | d2 |
BigInt | e |
BigInt | n |
BigInt | p |
BigInt | q |
This class represents public keys of integer factorization based (IF) public key schemes.
Botan::IF_Scheme_PrivateKey::IF_Scheme_PrivateKey | ( | RandomNumberGenerator & | rng, |
const BigInt & | prime1, | ||
const BigInt & | prime2, | ||
const BigInt & | exp, | ||
const BigInt & | d_exp, | ||
const BigInt & | mod | ||
) |
Definition at line 89 of file if_algo.cpp.
References c, d, d1, d2, Botan::IF_Scheme_PublicKey::e, exp, Botan::inverse_mod(), Botan::BigInt::is_even(), Botan::BigInt::is_nonzero(), Botan::lcm(), Botan::Private_Key::load_check(), Botan::IF_Scheme_PublicKey::n, p, and q.
Botan::IF_Scheme_PrivateKey::IF_Scheme_PrivateKey | ( | RandomNumberGenerator & | rng, |
const AlgorithmIdentifier & | alg_id, | ||
const MemoryRegion< byte > & | key_bits | ||
) |
Definition at line 69 of file if_algo.cpp.
References c, d, d1, d2, Botan::PEM_Code::decode(), Botan::BER_Decoder::decode_and_check(), Botan::IF_Scheme_PublicKey::e, Botan::Private_Key::load_check(), Botan::IF_Scheme_PublicKey::n, p, q, Botan::SEQUENCE, and Botan::BER_Decoder::start_cons().
|
inlineprotected |
|
pure virtualinherited |
Get the name of the underlying public key scheme.
Implemented in Botan::GOST_3410_PublicKey, Botan::ECDSA_PublicKey, Botan::ECDH_PublicKey, Botan::ElGamal_PublicKey, Botan::DH_PublicKey, Botan::DSA_PublicKey, Botan::NR_PublicKey, Botan::RSA_PublicKey, and Botan::RW_PublicKey.
Referenced by Botan::Certificate_Verify::Certificate_Verify(), Botan::EAC_Signed_Object::check_signature(), Botan::X509_Object::check_signature(), Botan::choose_sig_format(), Botan::X509::find_constraints(), Botan::Private_Key::gen_check(), Botan::Public_Key::get_oid(), Botan::Public_Key::load_check(), Botan::Private_Key::load_check(), Botan::PK_Decryptor_EME::PK_Decryptor_EME(), Botan::PK_Encryptor_EME::PK_Encryptor_EME(), Botan::PK_Key_Agreement::PK_Key_Agreement(), Botan::PK_Signer::PK_Signer(), Botan::PK_Verifier::PK_Verifier(), Botan::Server_Hello::Server_Hello(), Botan::Server_Key_Exchange::Server_Key_Exchange(), Botan::CMS_Encoder::sign(), and Botan::Server_Key_Exchange::verify().
|
virtualinherited |
Implements Botan::Public_Key.
Definition at line 15 of file if_algo.cpp.
References Botan::Public_Key::get_oid(), and Botan::AlgorithmIdentifier::USE_NULL_PARAM.
|
virtual |
Test the key values for consistency.
rng | rng to use |
strong | whether to perform strong and lengthy version of the test |
Reimplemented from Botan::IF_Scheme_PublicKey.
Reimplemented in Botan::RW_PrivateKey, and Botan::RSA_PrivateKey.
Definition at line 121 of file if_algo.cpp.
References c, Botan::check_prime(), d, d1, d2, Botan::IF_Scheme_PublicKey::e, Botan::inverse_mod(), Botan::BigInt::is_even(), Botan::IF_Scheme_PublicKey::n, p, and q.
Referenced by Botan::RSA_PrivateKey::check_key(), and Botan::RW_PrivateKey::check_key().
|
protectedinherited |
Self-test after generating a key
rng | a random number generator |
Definition at line 49 of file pk_keys.cpp.
References Botan::Public_Key::algo_name(), and Botan::Public_Key::check_key().
Referenced by Botan::DH_PrivateKey::DH_PrivateKey(), Botan::DSA_PrivateKey::DSA_PrivateKey(), Botan::ElGamal_PrivateKey::ElGamal_PrivateKey(), Botan::NR_PrivateKey::NR_PrivateKey(), Botan::RSA_PrivateKey::RSA_PrivateKey(), and Botan::RW_PrivateKey::RW_PrivateKey().
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineinherited |
Definition at line 44 of file if_algo.h.
Referenced by Botan::Server_Key_Exchange::Server_Key_Exchange().
|
inlineinherited |
Definition at line 39 of file if_algo.h.
References n.
Referenced by Botan::Server_Key_Exchange::Server_Key_Exchange().
|
virtualinherited |
Get the OID of the underlying public key scheme.
Definition at line 17 of file pk_keys.cpp.
References Botan::Public_Key::algo_name(), and Botan::OIDS::lookup().
Referenced by Botan::DL_Scheme_PublicKey::algorithm_identifier(), Botan::IF_Scheme_PublicKey::algorithm_identifier(), Botan::GOST_3410_PublicKey::algorithm_identifier(), and Botan::EC_PublicKey::algorithm_identifier().
|
inline |
|
inline |
|
protectedvirtualinherited |
Self-test after loading a key
rng | a random number generator |
Reimplemented in Botan::Private_Key.
Definition at line 31 of file pk_keys.cpp.
References Botan::Public_Key::algo_name(), and Botan::Public_Key::check_key().
|
protectedvirtualinherited |
Self-test after loading a key
rng | a random number generator |
Reimplemented from Botan::Public_Key.
Definition at line 40 of file pk_keys.cpp.
References Botan::Public_Key::algo_name(), and Botan::Public_Key::check_key().
Referenced by Botan::DH_PrivateKey::DH_PrivateKey(), Botan::DSA_PrivateKey::DSA_PrivateKey(), Botan::ElGamal_PrivateKey::ElGamal_PrivateKey(), IF_Scheme_PrivateKey(), and Botan::NR_PrivateKey::NR_PrivateKey().
|
inlinevirtualinherited |
Get the maximum message size in bits supported by this public key.
Implements Botan::Public_Key.
Definition at line 46 of file if_algo.h.
References n.
|
inlinevirtualinherited |
Find out the message part size supported by this scheme/key.
Reimplemented in Botan::GOST_3410_PublicKey, Botan::ECDSA_PublicKey, Botan::NR_PublicKey, and Botan::DSA_PublicKey.
|
inlinevirtualinherited |
Find out the number of message parts supported by this scheme.
Reimplemented in Botan::GOST_3410_PublicKey, Botan::ECDSA_PublicKey, Botan::NR_PublicKey, and Botan::DSA_PublicKey.
Definition at line 50 of file pk_keys.h.
Referenced by Botan::EAC_Signed_Object::check_signature(), Botan::X509_Object::check_signature(), and Botan::choose_sig_format().
|
inlinevirtualinherited |
Reimplemented in Botan::GOST_3410_PrivateKey.
Definition at line 98 of file pk_keys.h.
Referenced by Botan::PKCS8::BER_encode().
|
virtual |
Implements Botan::Private_Key.
Definition at line 52 of file if_algo.cpp.
References c, d, d1, d2, Botan::IF_Scheme_PublicKey::e, Botan::DER_Encoder::encode(), Botan::DER_Encoder::end_cons(), Botan::DER_Encoder::get_contents(), Botan::IF_Scheme_PublicKey::n, p, q, Botan::SEQUENCE, and Botan::DER_Encoder::start_cons().
|
virtualinherited |
Implements Botan::Public_Key.
Definition at line 21 of file if_algo.cpp.
References Botan::IF_Scheme_PublicKey::e, Botan::DER_Encoder::encode(), Botan::DER_Encoder::end_cons(), Botan::DER_Encoder::get_contents(), Botan::IF_Scheme_PublicKey::n, Botan::SEQUENCE, and Botan::DER_Encoder::start_cons().
|
protected |
Definition at line 101 of file if_algo.h.
Referenced by check_key(), IF_Scheme_PrivateKey(), pkcs8_private_key(), Botan::RSA_PrivateKey::RSA_PrivateKey(), and Botan::RW_PrivateKey::RW_PrivateKey().
|
protected |
Definition at line 101 of file if_algo.h.
Referenced by Botan::RSA_PrivateKey::check_key(), Botan::RW_PrivateKey::check_key(), check_key(), IF_Scheme_PrivateKey(), pkcs8_private_key(), Botan::RSA_PrivateKey::RSA_PrivateKey(), and Botan::RW_PrivateKey::RW_PrivateKey().
|
protected |
Definition at line 101 of file if_algo.h.
Referenced by check_key(), IF_Scheme_PrivateKey(), pkcs8_private_key(), Botan::RSA_PrivateKey::RSA_PrivateKey(), and Botan::RW_PrivateKey::RW_PrivateKey().
|
protected |
Definition at line 101 of file if_algo.h.
Referenced by check_key(), IF_Scheme_PrivateKey(), pkcs8_private_key(), Botan::RSA_PrivateKey::RSA_PrivateKey(), and Botan::RW_PrivateKey::RW_PrivateKey().
|
protectedinherited |
Definition at line 51 of file if_algo.h.
Referenced by Botan::IF_Scheme_PublicKey::check_key(), Botan::RSA_PrivateKey::check_key(), Botan::RW_PrivateKey::check_key(), check_key(), IF_Scheme_PrivateKey(), Botan::IF_Scheme_PublicKey::IF_Scheme_PublicKey(), pkcs8_private_key(), Botan::RSA_PrivateKey::RSA_PrivateKey(), Botan::RW_PrivateKey::RW_PrivateKey(), and Botan::IF_Scheme_PublicKey::x509_subject_public_key().
|
protectedinherited |
Definition at line 51 of file if_algo.h.
Referenced by Botan::IF_Scheme_PublicKey::check_key(), check_key(), IF_Scheme_PrivateKey(), Botan::IF_Scheme_PublicKey::IF_Scheme_PublicKey(), pkcs8_private_key(), Botan::RSA_PrivateKey::RSA_PrivateKey(), Botan::RW_PrivateKey::RW_PrivateKey(), and Botan::IF_Scheme_PublicKey::x509_subject_public_key().
|
protected |
Definition at line 101 of file if_algo.h.
Referenced by Botan::RSA_PrivateKey::check_key(), Botan::RW_PrivateKey::check_key(), check_key(), IF_Scheme_PrivateKey(), pkcs8_private_key(), Botan::RSA_PrivateKey::RSA_PrivateKey(), and Botan::RW_PrivateKey::RW_PrivateKey().
|
protected |
Definition at line 101 of file if_algo.h.
Referenced by Botan::RSA_PrivateKey::check_key(), Botan::RW_PrivateKey::check_key(), check_key(), IF_Scheme_PrivateKey(), pkcs8_private_key(), Botan::RSA_PrivateKey::RSA_PrivateKey(), and Botan::RW_PrivateKey::RW_PrivateKey().