diff options
author | lloyd <[email protected]> | 2010-03-04 05:20:59 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-03-04 05:20:59 +0000 |
commit | 2548328cc11d76036e8fc714172b130f2a8c3ebc (patch) | |
tree | a34b62ed0e5ca90b69f0a82ba8c00e41dc91b912 /src/pubkey/gost_3410 | |
parent | d490c5bed4331a4336556e08873fe03a792ad127 (diff) |
Quite the hack, here.
GOST 34.10 public keys use a funky encoding. There is no standard for
PKCS #8 format private keys, so the obvious choice is to act exactly
the same as ECDSA/ECDH (following the rule of thumb that if you're
going to make up a random non-standard thing, at least try to copy
something that's standard for something else). However the public key
encoding uses a weird scheme for encoding the OID in the algorithm
identifier, which we don't want to use for the PKCS #8 encoding.
Add a new function to Private_Key, pkcs8_algorithm_identifier, which
by default just calls algorithm_identifier(). However
GOST_3410_PrivateKey overrides it, and calls
EC_PublicKey::algorithm_identifier(), basically skipping over the
virtual function hierarchy, so it doesn't pick up the funky format
from the public key's version of algorithm_identifier().
Diffstat (limited to 'src/pubkey/gost_3410')
-rw-r--r-- | src/pubkey/gost_3410/gost_3410.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pubkey/gost_3410/gost_3410.h b/src/pubkey/gost_3410/gost_3410.h index 696daf0a7..669ed130f 100644 --- a/src/pubkey/gost_3410/gost_3410.h +++ b/src/pubkey/gost_3410/gost_3410.h @@ -103,6 +103,9 @@ class BOTAN_DLL GOST_3410_PrivateKey : public GOST_3410_PublicKey, GOST_3410_PrivateKey(const EC_Domain_Params& domain, const BigInt& x) : EC_PrivateKey(domain, x) {} + AlgorithmIdentifier pkcs8_algorithm_identifier() const + { return EC_PublicKey::algorithm_identifier(); } + /** * Sign a message with this key. * @param message the byte array representing the message to be signed |