aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey
diff options
context:
space:
mode:
Diffstat (limited to 'src/pubkey')
-rw-r--r--src/pubkey/gost_3410/gost_3410.cpp14
-rw-r--r--src/pubkey/gost_3410/gost_3410.h2
2 files changed, 13 insertions, 3 deletions
diff --git a/src/pubkey/gost_3410/gost_3410.cpp b/src/pubkey/gost_3410/gost_3410.cpp
index 47438653d..46afad44e 100644
--- a/src/pubkey/gost_3410/gost_3410.cpp
+++ b/src/pubkey/gost_3410/gost_3410.cpp
@@ -8,11 +8,8 @@
*/
#include <botan/gost_3410.h>
-#include <botan/numthry.h>
#include <botan/der_enc.h>
#include <botan/ber_dec.h>
-#include <botan/secmem.h>
-#include <botan/point_gfp.h>
namespace Botan {
@@ -30,6 +27,17 @@ MemoryVector<byte> GOST_3410_PublicKey::x509_subject_public_key() const
return DER_Encoder().encode(bits, OCTET_STRING).get_contents();
}
+AlgorithmIdentifier GOST_3410_PublicKey::algorithm_identifier() const
+ {
+ MemoryVector<byte> params =
+ DER_Encoder().start_cons(SEQUENCE)
+ .encode(OID(domain().get_oid()))
+ .end_cons()
+ .get_contents();
+
+ return AlgorithmIdentifier(get_oid(), params);
+ }
+
GOST_3410_PublicKey::GOST_3410_PublicKey(const AlgorithmIdentifier& alg_id,
const MemoryRegion<byte>& key_bits)
{
diff --git a/src/pubkey/gost_3410/gost_3410.h b/src/pubkey/gost_3410/gost_3410.h
index eb80943b1..696daf0a7 100644
--- a/src/pubkey/gost_3410/gost_3410.h
+++ b/src/pubkey/gost_3410/gost_3410.h
@@ -43,6 +43,8 @@ class BOTAN_DLL GOST_3410_PublicKey : public virtual EC_PublicKey,
*/
std::string algo_name() const { return "GOST-34.10"; }
+ AlgorithmIdentifier algorithm_identifier() const;
+
MemoryVector<byte> x509_subject_public_key() const;
/**