aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/ecc_key/ecc_key.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-04 01:53:35 +0000
committerlloyd <[email protected]>2010-03-04 01:53:35 +0000
commitf109029f5f1cc33512091e228e6ee6532058c42f (patch)
tree203d32fec16d05a2fc6c6f72346cb13a2796c71e /src/pubkey/ecc_key/ecc_key.cpp
parent547e295717780c28878f17b7273a7d60c1bf39c6 (diff)
Add a new function to Public_Key, algorithm_identifier(), which just
returns the AlgorithmIdentifier representing this scheme (OID + domain params if any).
Diffstat (limited to 'src/pubkey/ecc_key/ecc_key.cpp')
-rw-r--r--src/pubkey/ecc_key/ecc_key.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/pubkey/ecc_key/ecc_key.cpp b/src/pubkey/ecc_key/ecc_key.cpp
index 22d7aceb4..4a0b20d2f 100644
--- a/src/pubkey/ecc_key/ecc_key.cpp
+++ b/src/pubkey/ecc_key/ecc_key.cpp
@@ -35,6 +35,11 @@ EC_PublicKey::EC_PublicKey(const EC_Domain_Params& dom_par,
}
}
+AlgorithmIdentifier EC_PublicKey::algorithm_identifier() const
+ {
+ return AlgorithmIdentifier(get_oid(), DER_domain());
+ }
+
void EC_PublicKey::X509_load_hook()
{
try
@@ -54,8 +59,7 @@ X509_Encoder* EC_PublicKey::x509_encoder() const
public:
AlgorithmIdentifier alg_id() const
{
- return AlgorithmIdentifier(key->get_oid(),
- key->DER_domain());
+ return key->algorithm_identifier();
}
MemoryVector<byte> key_bits() const
@@ -161,8 +165,7 @@ PKCS8_Encoder* EC_PrivateKey::pkcs8_encoder() const
public:
AlgorithmIdentifier alg_id() const
{
- return AlgorithmIdentifier(key->get_oid(),
- key->domain().DER_encode(EC_DOMPAR_ENC_EXPLICIT));
+ return key->algorithm_identifier();
}
MemoryVector<byte> key_bits() const