R: R: PEM_read_RSAPublicKey problem

2008-07-01 Thread Marco Sommella
No no i do it correct.
PEM_read_RSAPrivateKey()
RSA_sign()

For sign and:

PEM_read_RSAPublicKey()
RSA_verify()

For verify

-Messaggio originale-
Da: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Per conto di Kenneth Goldman
Inviato: lunedì 30 giugno 2008 14.58
A: openssl-users@openssl.org
Oggetto: Re: R: PEM_read_RSAPublicKey problem

Perhaps the problem is that you're reading the public key and
trying to sign.  Signing uses a private key.

Try:

PEM_read_RSAPrivateKey()
RSA_sign()

[EMAIL PROTECTED] wrote on 06/27/2008 11:31:42 AM:

> Excuse me,
> I'm trying, using C, to do a simple sign and verify with RSA public and
> private keys on pem files.
> Which is the easy way?
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: R: PEM_read_RSAPublicKey problem

2008-07-01 Thread Kenneth Goldman
Perhaps the problem is that you're reading the public key and
trying to sign.  Signing uses a private key.

Try:

PEM_read_RSAPrivateKey()
RSA_sign()

[EMAIL PROTECTED] wrote on 06/27/2008 11:31:42 AM:

> Excuse me,
> I'm trying, using C, to do a simple sign and verify with RSA public and
> private keys on pem files.
> Which is the easy way?
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


R: PEM_read_RSAPublicKey problem

2008-06-27 Thread Marco Sommella
Excuse me,
I'm trying, using C, to do a simple sign and verify with RSA public and
private keys on pem files.
Which is the easy way?
Someone have some sample ?
TNX

-Messaggio originale-
Da: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Per conto di David Schwartz
Inviato: venerdì 27 giugno 2008 5.41
A: openssl-users@openssl.org
Oggetto: RE: PEM_read_RSAPublicKey problem


> hi again,
> i created a publickey.pem with command:
> openssl rsa -in myprivate.pem -pubout -out publickey.pem
>
> then in C i try to read this public key with:
> RSA *pubkey = PEM_read_RSAPublicKey(fp, NULL, NULL, NULL)
>
> where fp is the opened publickey.pem file.
>
> but it's return this error: error:0906D06C:lib(9):func(109):reason(108)
>
> where i'm wrong ?

Hmm:

error:0906D06C:PEM routines:PEM_read_bio:no start line

I believe you are mixing types. 'openssl rsa -pubout' writes out a key in
X.509 subjectPublicKeyInfo format. PEM_read_RSAPublicKey expects a raw RSA
key.

You have the same problem this guy had:
http://mail.nl.linux.org/tinc/2004-02/msg7.html

DS


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]