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:
Ricardo Guerra wrote:
hi all,
i've been having trouble with this pice of code, i get a segmentation fault
when reading the public key, this is the way i generated both private and
public keys.
priv Key: openssl genrsa -out priv.key 1024
pub Key: cat pub.key | openssl rsa -pubout
thanks :)
pubKey is supposed to be used to decrypt a string previously encrypted with
the privateKey (rsa_private_encrypt)..
by the way... is it possible? i have seen some code and openssl itself to
encrypt using public key and decrypt using the private key...
El MiƩrcoles 26 Diciembre 2001
Sorry,I asked to early, There is
nothing wrong with the code. The file is not a public key file (or the format
isd wrong) How do I extract a public key file from a
certificate?
Hylton
-Original Message-From: Hylton Tregenza
Sent: 16 November 2001 12:24To:
[EMAIL
Hylton Tregenza wrote:
Sorry, I asked to early, There is nothing wrong with the code. The file
is not a public key file (or the format isd wrong) How do I extract a
public key file from a certificate?
by command line:
$ openssl x509 -in cert.pem -pubkey -noout
by writing some code:
On Fri, 16 Nov 2001, Takaaki Ishii wrote:
Hylton Tregenza wrote:
Sorry, I asked to early, There is nothing wrong with the code. The file
is not a public key file (or the format isd wrong) How do I extract a
public key file from a certificate?
How about to use X509_get_pubkey
d p chang wrote:
Checking the user archives I haven't seen anyone address this sort of
problem (v0.9.6b).
Well it has been addressed before...
I've generated the various keys w/ something liek
this (from teh man page)
openssl genrsa -out priv.pem 1024
openssl rsa -in