diff options
Diffstat (limited to 'src/pubkey/ecc_key/ecc_key.cpp')
-rw-r--r-- | src/pubkey/ecc_key/ecc_key.cpp | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/src/pubkey/ecc_key/ecc_key.cpp b/src/pubkey/ecc_key/ecc_key.cpp index 4a0b20d2f..f91f394dc 100644 --- a/src/pubkey/ecc_key/ecc_key.cpp +++ b/src/pubkey/ecc_key/ecc_key.cpp @@ -40,6 +40,11 @@ AlgorithmIdentifier EC_PublicKey::algorithm_identifier() const return AlgorithmIdentifier(get_oid(), DER_domain()); } +MemoryVector<byte> EC_PublicKey::x509_subject_public_key() const + { + return EC2OSP(public_point(), PointGFp::COMPRESSED); + } + void EC_PublicKey::X509_load_hook() { try @@ -52,29 +57,6 @@ void EC_PublicKey::X509_load_hook() } } -X509_Encoder* EC_PublicKey::x509_encoder() const - { - class EC_Key_Encoder : public X509_Encoder - { - public: - AlgorithmIdentifier alg_id() const - { - return key->algorithm_identifier(); - } - - MemoryVector<byte> key_bits() const - { - return EC2OSP(key->public_point(), PointGFp::COMPRESSED); - } - - EC_Key_Encoder(const EC_PublicKey* k): key(k) {} - private: - const EC_PublicKey* key; - }; - - return new EC_Key_Encoder(this); - } - X509_Decoder* EC_PublicKey::x509_decoder() { class EC_Key_Decoder : public X509_Decoder |