|
Botan
1.11.4
|
#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 |
| size_t | estimated_strength () const override |
| const BigInt & | get_e () const |
| const BigInt & | get_n () const |
| virtual OID | get_oid () const |
| IF_Scheme_PublicKey (const AlgorithmIdentifier &alg_id, const secure_vector< byte > &key_bits) | |
| IF_Scheme_PublicKey (const BigInt &n, const BigInt &e) | |
| size_t | max_input_bits () const |
| virtual size_t | message_part_size () const |
| virtual size_t | message_parts () const |
| std::vector< byte > | x509_subject_public_key () const |
Protected Member Functions | |
| IF_Scheme_PublicKey () | |
| virtual void | load_check (RandomNumberGenerator &rng) const |
Protected Attributes | |
| BigInt | e |
| BigInt | n |
This class represents public keys of integer factorization based (IF) public key schemes.
| Botan::IF_Scheme_PublicKey::IF_Scheme_PublicKey | ( | const AlgorithmIdentifier & | alg_id, |
| const secure_vector< byte > & | key_bits | ||
| ) |
Definition at line 37 of file if_algo.cpp.
References Botan::BER_Decoder::decode(), e, Botan::BER_Decoder::end_cons(), n, Botan::SEQUENCE, Botan::BER_Decoder::start_cons(), and Botan::BER_Decoder::verify_end().
|
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::TLS::Certificate_Verify::Certificate_Verify(), Botan::EAC_Signed_Object::check_signature(), Botan::X509_Object::check_signature(), Botan::TLS::Handshake_State::choose_sig_format(), Botan::choose_sig_format(), Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), Botan::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(), and Botan::TLS::Handshake_State::understand_sig_format().
|
virtual |
Implements Botan::Public_Key.
Definition at line 21 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 |
Implements Botan::Public_Key.
Reimplemented in Botan::IF_Scheme_PrivateKey, Botan::RW_PrivateKey, and Botan::RSA_PrivateKey.
Definition at line 51 of file if_algo.cpp.
References e, Botan::BigInt::is_even(), and n.
|
overridevirtual |
Return the estimated strength of the underlying key against the best currently known attack. Note that this ignores anything but pure attacks against the key itself and do not take into account padding schemes, usage mistakes, etc which might reduce the strength. However it does suffice to provide an upper bound.
Implements Botan::Public_Key.
Definition at line 16 of file if_algo.cpp.
References Botan::BigInt::bits(), Botan::dl_work_factor(), and n.
|
inline |
|
inline |
|
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(), algorithm_identifier(), Botan::GOST_3410_PublicKey::algorithm_identifier(), and Botan::EC_PublicKey::algorithm_identifier().
|
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().
|
inlinevirtual |
|
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 61 of file pk_keys.h.
Referenced by Botan::EAC_Signed_Object::check_signature(), Botan::X509_Object::check_signature(), and Botan::choose_sig_format().
|
virtual |
Implements Botan::Public_Key.
Definition at line 27 of file if_algo.cpp.
References e, Botan::DER_Encoder::encode(), Botan::DER_Encoder::end_cons(), Botan::DER_Encoder::get_contents_unlocked(), n, Botan::SEQUENCE, and Botan::DER_Encoder::start_cons().
|
protected |
Definition at line 53 of file if_algo.h.
Referenced by check_key(), Botan::RSA_PrivateKey::check_key(), Botan::RW_PrivateKey::check_key(), Botan::IF_Scheme_PrivateKey::check_key(), Botan::IF_Scheme_PrivateKey::IF_Scheme_PrivateKey(), IF_Scheme_PublicKey(), Botan::IF_Scheme_PrivateKey::pkcs8_private_key(), Botan::RSA_PrivateKey::RSA_PrivateKey(), Botan::RW_PrivateKey::RW_PrivateKey(), and x509_subject_public_key().
|
protected |
Definition at line 53 of file if_algo.h.
Referenced by check_key(), Botan::IF_Scheme_PrivateKey::check_key(), estimated_strength(), Botan::IF_Scheme_PrivateKey::IF_Scheme_PrivateKey(), IF_Scheme_PublicKey(), Botan::IF_Scheme_PrivateKey::pkcs8_private_key(), Botan::RSA_PrivateKey::RSA_PrivateKey(), Botan::RW_PrivateKey::RW_PrivateKey(), and x509_subject_public_key().
1.8.3.1