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/gost_3410 | |
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/gost_3410')
-rw-r--r-- | src/pubkey/gost_3410/gost_3410.h | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/pubkey/gost_3410/gost_3410.h b/src/pubkey/gost_3410/gost_3410.h index c1cd0d293..345833ede 100644 --- a/src/pubkey/gost_3410/gost_3410.h +++ b/src/pubkey/gost_3410/gost_3410.h @@ -23,6 +23,22 @@ class BOTAN_DLL GOST_3410_PublicKey : public virtual EC_PublicKey, public: /** + * Construct a public key from a given public point. + * @param dom_par the domain parameters associated with this key + * @param public_point the public point defining this key + */ + GOST_3410_PublicKey(const EC_Domain_Params& dom_par, + const PointGFp& public_point) : + EC_PublicKey(dom_par, public_point) {} + + /** + * Construct from X.509 algorithm id and subject public key bits + */ + GOST_3410_PublicKey(const AlgorithmIdentifier& alg_id, + const MemoryRegion<byte>& key_bits) : + EC_PublicKey(alg_id, key_bits) {} + + /** * Get this keys algorithm name. * @result this keys algorithm name */ @@ -54,26 +70,14 @@ class BOTAN_DLL GOST_3410_PublicKey : public virtual EC_PublicKey, const byte signature[], u32bit sig_len) const; /** - * Default constructor. Use this one if you want to later fill - * this object with data from an encoded key. - */ - GOST_3410_PublicKey() {} - - /** - * Construct a public key from a given public point. - * @param dom_par the domain parameters associated with this key - * @param public_point the public point defining this key - */ - GOST_3410_PublicKey(const EC_Domain_Params& dom_par, - const PointGFp& public_point) : - EC_PublicKey(dom_par, public_point) {} - - /** * Get an x509_decoder that can be used to decode a stored key into * this key. * @result an x509_decoder for this key */ X509_Decoder* x509_decoder(); + + protected: + GOST_3410_PublicKey() {} }; /** |