Re: How can I load a PEM key stored in a string instead from a file?

2010-10-29 Thread Leandro Santiago
ge- > From: owner-openssl-us...@openssl.org > [mailto:owner-openssl-us...@openssl.org] On Behalf Of Leandro Santiago > Sent: Friday, October 29, 2010 7:26 AM > To: openssl-users@openssl.org > Subject: Re: How can I load a PEM key stored in a string instead from a file? >

RE: How can I load a PEM key stored in a string instead from a file?

2010-10-29 Thread Erik Tkal
: openssl-users@openssl.org Subject: Re: How can I load a PEM key stored in a string instead from a file? Thanks to all. I've resolved my first problem, load the PEM from a string. I've used BIO_new_mem_buf() and PEM_read_bio_PrivateKey(). But now I've seen that it works well wit

Re: How can I load a PEM key stored in a string instead from a file?

2010-10-29 Thread Leandro Santiago
Thanks to all. I've resolved my first problem, load the PEM from a string. I've used BIO_new_mem_buf() and PEM_read_bio_PrivateKey(). But now I've seen that it works well with PEM keys, and now I'm trying to use a DER key, again from a string. Is there something like DER_read_bio_PrivateKey()? 20

Re: How can I load a PEM key stored in a string instead from a file?

2010-10-27 Thread Michael S. Zick
On Tue October 26 2010, Leandro Santiago wrote: > Sorry. I don't understand everything. Do you have any code example? > I've tried to read the source code of these functions, but > PEM_read_PrivateKey is a macro (and I hate read big macros) :-( > gcc -E ... >output.txt Is your answer to that comp

Re: How can I load a PEM key stored in a string instead from a file?

2010-10-26 Thread Leandro Santiago
Sorry. I don't understand everything. Do you have any code example? I've tried to read the source code of these functions, but PEM_read_PrivateKey is a macro (and I hate read big macros) :-( 2010/10/26 Wim Lewis : > PEM_read_PrivateKey() is a wrapper around PEM_ASN1_read() (which reads an > arbit

Re: How can I load a PEM key stored in a string instead from a file?

2010-10-26 Thread Wim Lewis
PEM_read_PrivateKey() is a wrapper around PEM_ASN1_read() (which reads an arbitrary ASN.1 object from a PEM-encoded blob) and d2i_PrivateKey() (which knows how to read a private key blob specifically). PEM_ASN1_read() simply creates a BIO from the FILE* that you give it, and calls PEM_ASN1_read

How can I load a PEM key stored in a string instead from a file?

2010-10-26 Thread Leandro Santiago
Hello to all. I'm using the openssl api in a C application. Currently to load a private key (generated by openssl command), I do: _privKeyFile = fopen(filename, "rt"); _privKey = PEM_read_PrivateKey(_privKeyFile, NULL, NULL, NULL); _rsa = EVP_PKEY_get1_RSA(_privKey); The _rsa is the object I