Abhisek Datta wrote:
-----BEGIN RSA PUBLIC KEY-----
MIGJAoGBALxi3tGXlSwRgn7/Km6mTSge+5ijQgIn3GvnZOeYyOo1DkubVtTaFj26
GWtJo43MEe1a5UlWKJEOpbKVCr4AASfFj8YmmRewH4SXdZ+w1B ad8amyzL2h8F7J
wJojOnocSs6xDE7o86CpZRUlojBefanMdCpu074QFktE63OD1z BBAgMBAAE=
-----END RSA PUBLIC KEY-----
Traceback (most recent call last):
[...] M2Crypto.RSA.RSAError: no start line
The files in M2Crypto tests directory don't have any files that have
"BEGIN RSA PUBLIC KEY" in them - haven't checked if this is legal or not.
However, plain OpenSSL does not like that file either:
$ openssl rsa -in rsa_heikki.pem -pubin
3440:error:0906D06C:PEM routines:PEM_read_bio:no
startline:pem_lib.c:644:Expecting: PUBLIC KEY
$ openssl rsa -in rsa_heikki.pem -check
2140:error:0906D06C:PEM routines:PEM_read_bio:no
startline:pem_lib.c:644:Expecting: ANY PRIVATE KEY
If I take out the "RSA " part from the delimiter lines I get:
$ openssl rsa -in rsa_heikki2.pem -pubin
unable to load Public Key
3124:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong
tag:tasn_dec.c:
1282:
3124:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1
error:ta
sn_dec.c:374:Type=X509_ALGOR
3124:error:0D08303A:asn1 encoding
routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 e
rror:tasn_dec.c:743:Field=algor, Type=X509_PUBKEY
3124:error:0906700D:PEM routines:PEM_ASN1_read_bio:ASN1 lib:pem_oth.c:83:
$ openssl rsa -in rsa_heikki2.pem -check
unable to load Private Key
2304:error:0906D06C:PEM routines:PEM_read_bio:no start
line:pem_lib.c:644:Expect
ing: ANY PRIVATE KEY
My suggestion would be to ask on the openssl-users list.
--
Heikki Toivonen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Using GnuPG with Mozilla -
http://enigmail.mozdev.org
iD8DBQFD+2WNb8x8KoP+JuwRAmC2AJ0fYurEBdoLb+b885bUoL z9nQ0fmwCgqFjv
UTLYnmP31hUrq+cO46QAywI=
=lLfI
-----END PGP SIGNATURE-----