I have DER encoded RSA public key (after base64):
"MIIBBwKCAQBf42Zfu4JZO
+TkTfg175snmSufpHZsPsHi0KizooC8CuffxXADkRJCSWPfmYaE".
"GKGz/BN7xdDw5dS9JJC
+sJdbK8+u2DYqJGhUQxkQtcShuoW5xGEkRo0mb93PJRFHsFdgHNhM".
"C4ajss2X
+NcnvnLVMhFUDaQX40mTBHx0Er1GvFh7VhjgJKAEs8L3TpJC0wdOFADFMZ7PPQaN".
"0YhfstwY+hnKO8GSA/1pVw+riDwhIeyVCiq
+j7ZZCs6C63a2sQJc7YOFN0E0Vuh1i98M1n3A".
"rMZ+bEn6LfeDdcgZxMPZ3ELGcNPlCF9t83q8TYxLv7ZDUPaCz5sywsbRH9qEgp1JAgER"
If i base64 decide it and saves into test.der file i can perfectly
parse it:
earnol@SVA1:~$ openssl asn1parse -inform der -in temp.der -dump
0:d=0 hl=4 l= 263 cons: SEQUENCE
4:d=1 hl=4 l= 256 prim: INTEGER :
5FE3665FBB82593BE4E44DF835EF9B27992B9FA4766C3EC1E2D0A8B3A280BC0AE7DFC570039112424963DF99868418A1B3FC137BC5D0F0E5D4BD2490BEB0975B2BCFAED8362A246854431910B5C4A1BA85B9C46124468D266FDDCF251147B057601CD84C0B86A3B2CD97F8D727BE72D53211540DA417E34993047C7412BD46BC587B5618E024A004B3C2F74E9242D3074E1400C5319ECF3D068DD1885FB2DC18FA19CA3BC19203FD69570FAB883C2121EC950A2ABE8FB6590ACE82EB76B6B1025CED838537413456E8758BDF0CD67DC0ACC67E6C49FA2DF78375C819C4C3D9DC42C670D3E5085F6DF37ABC4D8C4BBFB64350F682CF9B32C2C6D11FDA84829D49
264:d=1 hl=2 l= 1 prim: INTEGER :11
However if i want to convert it into PEM format for further processing
with openSSL i get an error:
earnol@SVA1:~$ openssl rsa -in temp.der -inform DER -pubin -pubout -
outform PEM -out temp.pem
unable to load Public Key
5683:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong
tag:tasn_dec.c:1316:
5683:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested
asn1 error:tasn_dec.c:380:Type=X509_ALGOR
5683:error:0D08303A:asn1 encoding
routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error:tasn_dec.c:
748:Field=algor, Type=X509_PUBKEY
I do not understand what i'm doing wrong. According to documentation
everything should be ok, bute definitely wrong.
earnol@SVA1:~$ openssl version
OpenSSL 0.9.8k 25 Mar 2009
CryptoPP is latest version.
--
You received this message because you are subscribed to the "Crypto++ Users"
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at
http://www.cryptopp.com.