Well, you got me there, it was dumpasn1 and not asn1parse. Sorry. Anyway, I tried the same at work today, and the dump gave me the desired result. I'm not sure what made it work, but I suspect it had something to with a base64 decoder at home. When I'm not using a decoder, it works great. Also when I use my decoder at work (which is a different one from the one at home) it works. (I used the base 64 decoder to be able to use dumpasn1) Thanks for helping -Atle >>> [EMAIL PROTECTED] 3. august 2000 02:37:27 >>> Atle Sandvold wrote: > > Hi! > > I'm trying to export the public key from a PKCS#10 file. > > When I use > > PEM_write_RSAPublicKey(stdout,rsakey->pkey.rsa); > > it looks like I only get the modulus, and not the exponent. > When I do a asn1parse of the result, I get this: > ---- > 0 30 137: SEQUENCE { > 3 02 129: INTEGER > : 00 EE D7 22 C4 47 96 11 24 2E 45 5B 4B F6 8D 31 > : 91 66 D5 AD 2A C7 91 C4 72 9C 88 CA E5 54 42 B3 > : 92 64 54 F7 42 5C E1 3B 64 46 C1 3C 88 17 FA F8 > : 39 86 16 9A FF DA 57 D7 79 A1 51 2C 85 54 1E B1 > : E6 23 CF 8B 92 AD DB CC BE 93 A1 62 0B DA 2C C1 > : 11 C8 43 0F 73 79 C9 EC 05 32 4F 5D BC AF 33 20 > : CD 04 CD 3D 6C 0D 11 DA 71 2D 5F 46 18 74 7A E8 > : B9 D8 14 12 EB 2F CF 0D 0A 31 92 76 11 2D 5B 7E > : [ Another 1 bytes skipped ] > 135 95 2: [21] > : 03 01 > Error: Inconsistent object length, 1 byte difference. > : } > > 0 warnings, 1 error. > Hmmm looks more like dumpasn1 that asn1parse to me :-) Anyway just a shot in the dark, that 0D 0A looks suspicious are you writing the thing in text mode to stdout? Steve. -- Dr Stephen N. Henson. http://www.drh-consultancy.demon.co.uk/ Personal Email: [EMAIL PROTECTED] Senior crypto engineer, Celo Communications: http://www.celocom.com/ Core developer of the OpenSSL project: http://www.openssl.org/ Business Email: [EMAIL PROTECTED] PGP key: via homepage. ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED] ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]