Botan
1.10.9
|
#include <dl_algo.h>
Public Member Functions | |
virtual std::string | algo_name () const =0 |
AlgorithmIdentifier | algorithm_identifier () const |
bool | check_key (RandomNumberGenerator &rng, bool) const |
DL_Scheme_PublicKey (const AlgorithmIdentifier &alg_id, const MemoryRegion< byte > &key_bits, DL_Group::Format group_format) | |
const DL_Group & | get_domain () const |
virtual OID | get_oid () const |
const BigInt & | get_y () const |
virtual DL_Group::Format | group_format () const =0 |
const BigInt & | group_g () const |
const BigInt & | group_p () const |
const BigInt & | group_q () const |
virtual size_t | max_input_bits () const =0 |
virtual size_t | message_part_size () const |
virtual size_t | message_parts () const |
MemoryVector< byte > | x509_subject_public_key () const |
Protected Member Functions | |
DL_Scheme_PublicKey () | |
virtual void | load_check (RandomNumberGenerator &rng) const |
Protected Attributes | |
DL_Group | group |
BigInt | y |
Botan::DL_Scheme_PublicKey::DL_Scheme_PublicKey | ( | const AlgorithmIdentifier & | alg_id, |
const MemoryRegion< byte > & | key_bits, | ||
DL_Group::Format | group_format | ||
) |
Definition at line 26 of file dl_algo.cpp.
References Botan::DL_Group::BER_decode(), Botan::BER_Decoder::decode(), group, Botan::AlgorithmIdentifier::parameters, and y.
|
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().
|
virtual |
Implements Botan::Public_Key.
Definition at line 15 of file dl_algo.cpp.
References Botan::DL_Group::DER_encode(), Botan::Public_Key::get_oid(), group, and group_format().
|
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::DL_Scheme_PrivateKey, Botan::DSA_PrivateKey, Botan::ElGamal_PrivateKey, and Botan::NR_PrivateKey.
Definition at line 54 of file dl_algo.cpp.
References group, group_p(), and Botan::DL_Group::verify_group().
|
inline |
Get the DL domain parameters of this key.
Definition at line 33 of file dl_algo.h.
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 algorithm_identifier(), Botan::IF_Scheme_PublicKey::algorithm_identifier(), Botan::GOST_3410_PublicKey::algorithm_identifier(), and Botan::EC_PublicKey::algorithm_identifier().
|
inline |
Get the public value y with y = g^x mod p where x is the secret key.
Definition at line 38 of file dl_algo.h.
Referenced by Botan::ElGamal_Encryption_Operation::ElGamal_Encryption_Operation().
|
pure virtual |
Get the underlying groups encoding format.
Implemented in Botan::DH_PublicKey, Botan::DSA_PublicKey, Botan::ElGamal_PublicKey, and Botan::NR_PublicKey.
Referenced by algorithm_identifier().
|
inline |
Get the generator g of the underlying DL group.
Definition at line 56 of file dl_algo.h.
Referenced by Botan::DL_Scheme_PrivateKey::check_key(), Botan::DH_PrivateKey::DH_PrivateKey(), Botan::DSA_PrivateKey::DSA_PrivateKey(), Botan::DSA_Verification_Operation::DSA_Verification_Operation(), Botan::ElGamal_Encryption_Operation::ElGamal_Encryption_Operation(), Botan::ElGamal_PrivateKey::ElGamal_PrivateKey(), Botan::NR_PrivateKey::NR_PrivateKey(), and Botan::NR_Verification_Operation::NR_Verification_Operation().
|
inline |
Get the prime p of the underlying DL group.
Definition at line 44 of file dl_algo.h.
Referenced by check_key(), Botan::DL_Scheme_PrivateKey::check_key(), Botan::DH_PrivateKey::DH_PrivateKey(), Botan::DSA_PrivateKey::DSA_PrivateKey(), Botan::DSA_Verification_Operation::DSA_Verification_Operation(), Botan::ElGamal_Decryption_Operation::ElGamal_Decryption_Operation(), Botan::ElGamal_Encryption_Operation::ElGamal_Encryption_Operation(), Botan::ElGamal_PrivateKey::ElGamal_PrivateKey(), Botan::NR_PrivateKey::NR_PrivateKey(), Botan::NR_Verification_Operation::NR_Verification_Operation(), and Botan::DH_PublicKey::public_value().
|
inline |
Get the prime q of the underlying DL group.
Definition at line 50 of file dl_algo.h.
Referenced by Botan::NR_PrivateKey::check_key(), Botan::DSA_PrivateKey::check_key(), Botan::DSA_PrivateKey::DSA_PrivateKey(), Botan::DSA_Verification_Operation::DSA_Verification_Operation(), Botan::NR_PrivateKey::NR_PrivateKey(), and Botan::NR_Verification_Operation::NR_Verification_Operation().
|
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().
|
pure virtualinherited |
Get the maximum message size in bits supported by this public key.
Implemented in Botan::GOST_3410_PublicKey, Botan::ECDH_PublicKey, Botan::ECDSA_PublicKey, Botan::IF_Scheme_PublicKey, Botan::NR_PublicKey, Botan::DSA_PublicKey, Botan::ElGamal_PublicKey, and Botan::DH_PublicKey.
Referenced by Botan::choose_sig_format().
|
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().
|
virtual |
Implements Botan::Public_Key.
Definition at line 21 of file dl_algo.cpp.
References Botan::DER_Encoder::encode(), Botan::DER_Encoder::get_contents(), and y.
|
protected |
The DL group
Definition at line 79 of file dl_algo.h.
Referenced by algorithm_identifier(), check_key(), Botan::DL_Scheme_PrivateKey::check_key(), Botan::DH_PrivateKey::DH_PrivateKey(), Botan::DH_PublicKey::DH_PublicKey(), Botan::DL_Scheme_PrivateKey::DL_Scheme_PrivateKey(), DL_Scheme_PublicKey(), Botan::DSA_PrivateKey::DSA_PrivateKey(), Botan::DSA_PublicKey::DSA_PublicKey(), Botan::ElGamal_PrivateKey::ElGamal_PrivateKey(), Botan::ElGamal_PublicKey::ElGamal_PublicKey(), Botan::NR_PrivateKey::NR_PrivateKey(), and Botan::NR_PublicKey::NR_PublicKey().
|
protected |
The DL public key
Definition at line 74 of file dl_algo.h.
Referenced by Botan::DL_Scheme_PrivateKey::check_key(), Botan::DH_PrivateKey::DH_PrivateKey(), Botan::DH_PublicKey::DH_PublicKey(), DL_Scheme_PublicKey(), Botan::DSA_PrivateKey::DSA_PrivateKey(), Botan::DSA_PublicKey::DSA_PublicKey(), Botan::ElGamal_PrivateKey::ElGamal_PrivateKey(), Botan::ElGamal_PublicKey::ElGamal_PublicKey(), Botan::NR_PrivateKey::NR_PrivateKey(), Botan::NR_PublicKey::NR_PublicKey(), Botan::DH_PublicKey::public_value(), and x509_subject_public_key().