aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/pk_codecs/x509_key.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pubkey/pk_codecs/x509_key.cpp')
-rw-r--r--src/pubkey/pk_codecs/x509_key.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/pubkey/pk_codecs/x509_key.cpp b/src/pubkey/pk_codecs/x509_key.cpp
index fcfb2b165..fdcfccf87 100644
--- a/src/pubkey/pk_codecs/x509_key.cpp
+++ b/src/pubkey/pk_codecs/x509_key.cpp
@@ -24,15 +24,11 @@ namespace X509 {
*/
void encode(const Public_Key& key, Pipe& pipe, X509_Encoding encoding)
{
- std::auto_ptr<X509_Encoder> encoder(key.x509_encoder());
- if(!encoder.get())
- throw Encoding_Error("X509::encode: Key does not support encoding");
-
MemoryVector<byte> der =
DER_Encoder()
.start_cons(SEQUENCE)
- .encode(encoder->alg_id())
- .encode(encoder->key_bits(), BIT_STRING)
+ .encode(key.algorithm_identifier())
+ .encode(key.x509_subject_public_key(), BIT_STRING)
.end_cons()
.get_contents();