aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/dl_algo/dl_algo.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/dl_algo/dl_algo.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/dl_algo/dl_algo.cpp')
-rw-r--r--src/pubkey/dl_algo/dl_algo.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/pubkey/dl_algo/dl_algo.cpp b/src/pubkey/dl_algo/dl_algo.cpp
index 8ce34465a..beaf10695 100644
--- a/src/pubkey/dl_algo/dl_algo.cpp
+++ b/src/pubkey/dl_algo/dl_algo.cpp
@@ -12,6 +12,12 @@
namespace Botan {
+AlgorithmIdentifier DL_Scheme_PublicKey::algorithm_identifier() const
+ {
+ return AlgorithmIdentifier(get_oid(),
+ group.DER_encode(group_format()));
+ }
+
/*
* Return the X.509 public key encoder
*/
@@ -22,10 +28,7 @@ X509_Encoder* DL_Scheme_PublicKey::x509_encoder() const
public:
AlgorithmIdentifier alg_id() const
{
- MemoryVector<byte> group =
- key->group.DER_encode(key->group_format());
-
- return AlgorithmIdentifier(key->get_oid(), group);
+ return key->algorithm_identifier();
}
MemoryVector<byte> key_bits() const
@@ -79,10 +82,7 @@ PKCS8_Encoder* DL_Scheme_PrivateKey::pkcs8_encoder() const
public:
AlgorithmIdentifier alg_id() const
{
- MemoryVector<byte> group =
- key->group.DER_encode(key->group_format());
-
- return AlgorithmIdentifier(key->get_oid(), group);
+ return key->algorithm_identifier();
}
MemoryVector<byte> key_bits() const