On Mon, May 03, 2004, Eleanor Nagai wrote:

> Steven,
> 
> Hi!
> 
> Thanks very much for your response.  I tried the -keyform option in the dgst
> command but get the message "unable to load key file".  So I tried your
> suggestion
> to convert the key to pem format using:
>       
>       openssl rsa -in <key file> -pubin -inform der -pubout -outform pem
> 
> but got the following message:
> 
>       unable to load Public Key
>       12823:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong
> tag:tasn_dec.c:946
>       12823:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested
> asn1 error:tasn_dec.c:304:Type=X509_PUBKEY
> 
> The asn1parse tool doesn't seem to be able to understand the key file either
> as:
> 
>       openssl asn1parse -inform <der|txt> -in <key file> -dump
> 
> returns
>       
>       0:d=0 hl=2 l=  48 cons:PRINTABLESTRING
>       Error in encoding
>       12829:error:0D07209B:asn1 encoding routines:ASN1_get_object:too
> long:asn1_lib.c:132:
> 

Well 48 = ASCII '0' so it seems like your data really is in hex format. You'll
need to convert it to a binary file first either by writing a program or using
a utility: IIRC the xxd utility can do this.

After that it depends on what format the data is in. If its a
subjectPublicKeyInfo structure OpenSSL should have no problems with it. If its
and RSAPublicKey you'll need to convert it because currently there's no
command line options to handle that.

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to