Stephen,

thank you.

The command

openssl rsautl -verify -in signature.bin -inkey public.der -pubin -keyform
DER -out signout.bin

Causes error:

RSA operation error
4294560507:error:0407006A:rsa routines:RSA_padding_check_PKCS1_type_1:block
type
 is not 01:crypto/rsa/rsa_pk1.c:100:
4294560507:error:04067072:rsa routines:RSA_EAY_PUBLIC_DECRYPT:padding check
fail
ed:crypto/rsa/rsa_eay.c:580:

If I replace signature.bin  with sign.bin file, all is OK

Why signature.bin causes error ?



----- Original Message -----
From: "Dr. Stephen Henson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 14, 2004 11:20 PM
Subject: Re: DER public key file structure


> On Tue, Dec 14, 2004, Andrus wrote:
>
> > I need to decrypt RSA signature using RSA public key.
> > Thanks to Nils Larsch  reply I discovered that the following command can
be
> > used for this:
> >
> > openssl rsautl -verify -in sig.bin -inkey public.der -pubin -keyform
> > DER -out signout.bin
> >
> > I have a RSA 1024 bits modulus and exponent 3
> >
> > I need to create a public.der file (160 bytes) from this data to be
passed
> > to openssl using not a C language.
> >
> > I looked into  openssl sources but havent yet found DER file structure
> > description.
> >
> > Where I can found the DER public file structure description which this
> > command accepts ?
> >
>
> Its a SubjectPublicKeyInfo structure. You can create it either
programatically
> or using the mini-ASN1 compiler in OpenSSL 0.9.8-dev.
>
> There's an example of the latter at:
>
> http://www.openssl.org/docs/crypto/ASN1_generate_nconf.html#EXAMPLES
>
> 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
> User Support Mailing List                    [EMAIL PROTECTED]
> Automated List Manager                           [EMAIL PROTECTED]
>

Attachment: public.der
Description: application/pkix-cert

Attachment: sig.bin
Description: Binary data

Attachment: signature.bin
Description: Binary data

Reply via email to