diff options
author | lloyd <[email protected]> | 2010-03-04 03:22:35 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-03-04 03:22:35 +0000 |
commit | 76f39cc9fe4b2a3354db22f8beaf0c3788578b79 (patch) | |
tree | c25ddaf29f22dc29786487d606d68c2344c46f22 /src/pubkey/dh/dh.h | |
parent | da09382f398dcf27a3ffdb82dd9f916ba96567ac (diff) |
Add a new constructor to each public key algorithm (only the public
keys so far, private keys not changed) that takes an
AlgorithmIdentifier and a MemoryRegion<byte>&. This performs the X.509
decoding. It is not possible anymore to create uninitialized PK
objects.
Diffstat (limited to 'src/pubkey/dh/dh.h')
-rw-r--r-- | src/pubkey/dh/dh.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/pubkey/dh/dh.h b/src/pubkey/dh/dh.h index fa558bce2..7b81008a3 100644 --- a/src/pubkey/dh/dh.h +++ b/src/pubkey/dh/dh.h @@ -26,11 +26,10 @@ class BOTAN_DLL DH_PublicKey : public virtual DL_Scheme_PublicKey DL_Group::Format group_format() const { return DL_Group::ANSI_X9_42; } - /** - * Construct an uninitialized key. Use this constructor if you wish - * to decode an encoded key into the new instance. - */ - DH_PublicKey() {} + DH_PublicKey(const AlgorithmIdentifier& alg_id, + const MemoryRegion<byte>& key_bits) : + DL_Scheme_PublicKey(alg_id, key_bits, DL_Group::ANSI_X9_42) + { X509_load_hook(); } /** * Construct a public key with the specified parameters. @@ -38,6 +37,8 @@ class BOTAN_DLL DH_PublicKey : public virtual DL_Scheme_PublicKey * @param y the public value y */ DH_PublicKey(const DL_Group& grp, const BigInt& y); + protected: + DH_PublicKey() {} private: void X509_load_hook(); }; |