diff options
author | lloyd <[email protected]> | 2010-03-04 03:49:35 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-03-04 03:49:35 +0000 |
commit | fe9aa5acece6c004f2c1c1aa4b23d7c44207672f (patch) | |
tree | 56bf2fc8378d965138e29074c23f645ed5d1a947 /src/pubkey/dsa/dsa.h | |
parent | de89566f633d5ed807ca57a59cc1071f79fdded3 (diff) |
Add similar decoding constructors to the private keys
Diffstat (limited to 'src/pubkey/dsa/dsa.h')
-rw-r--r-- | src/pubkey/dsa/dsa.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/pubkey/dsa/dsa.h b/src/pubkey/dsa/dsa.h index 302715222..c263d4ec8 100644 --- a/src/pubkey/dsa/dsa.h +++ b/src/pubkey/dsa/dsa.h @@ -35,8 +35,8 @@ class BOTAN_DLL DSA_PublicKey : public PK_Verifying_wo_MR_Key, { X509_load_hook(); } DSA_PublicKey(const DL_Group& group, const BigInt& y); - DSA_PublicKey() {} protected: + DSA_PublicKey() {} DSA_Core core; private: void X509_load_hook(); @@ -50,14 +50,23 @@ class BOTAN_DLL DSA_PrivateKey : public DSA_PublicKey, public virtual DL_Scheme_PrivateKey { public: - SecureVector<byte> sign(const byte[], u32bit, + SecureVector<byte> sign(const byte hash[], u32bit hash_len, RandomNumberGenerator& rng) const; - bool check_key(RandomNumberGenerator& rng, bool) const; + bool check_key(RandomNumberGenerator& rng, bool strong) const; + + DSA_PrivateKey(const AlgorithmIdentifier& alg_id, + const MemoryRegion<byte>& key_bits, + RandomNumberGenerator& rng) : + DL_Scheme_PrivateKey(alg_id, key_bits, DL_Group::ANSI_X9_57) + { + PKCS8_load_hook(rng); + } + + DSA_PrivateKey(RandomNumberGenerator& rng, + const DL_Group& group, + const BigInt& private_key = 0); - DSA_PrivateKey() {} - DSA_PrivateKey(RandomNumberGenerator&, const DL_Group&, - const BigInt& = 0); private: void PKCS8_load_hook(RandomNumberGenerator& rng, bool = false); }; |