aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/ecdsa
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-04 03:22:35 +0000
committerlloyd <[email protected]>2010-03-04 03:22:35 +0000
commit76f39cc9fe4b2a3354db22f8beaf0c3788578b79 (patch)
treec25ddaf29f22dc29786487d606d68c2344c46f22 /src/pubkey/ecdsa
parentda09382f398dcf27a3ffdb82dd9f916ba96567ac (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/ecdsa')
-rw-r--r--src/pubkey/ecdsa/ecdsa.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/pubkey/ecdsa/ecdsa.h b/src/pubkey/ecdsa/ecdsa.h
index e7f29b600..4beb531b0 100644
--- a/src/pubkey/ecdsa/ecdsa.h
+++ b/src/pubkey/ecdsa/ecdsa.h
@@ -23,6 +23,19 @@ class BOTAN_DLL ECDSA_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
+ */
+ ECDSA_PublicKey(const EC_Domain_Params& dom_par,
+ const PointGFp& public_point) :
+ EC_PublicKey(dom_par, public_point) {}
+
+ ECDSA_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 ("ECDSA")
*/
@@ -50,21 +63,8 @@ class BOTAN_DLL ECDSA_PublicKey : public virtual EC_PublicKey,
bool verify(const byte message[], u32bit mess_len,
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.
- */
+ protected:
ECDSA_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
- */
- ECDSA_PublicKey(const EC_Domain_Params& dom_par,
- const PointGFp& public_point) :
- EC_PublicKey(dom_par, public_point) {}
-
};
/**