Re: [EVP_PKEY] How to duplicate it ?

2008-05-26 Thread delcour.pierre
Thomas Mangold wrote: Why not just copy the key? EVP_PKEY *cp_key (EVP_PKEY *pkey) { /* error handling omittet */ EVP_PKEY *pnew; int key_type; pnew = EVP_PKEY_new(); switch(pkey->type) { case EVP_PKEY_RSA: DSA *dsa = EVP_PKEY_get1_DSA(pkey); EVP_PKEY_s

Re: [EVP_PKEY] How to duplicate it ?

2008-05-23 Thread Richard Levitte
In message <[EMAIL PROTECTED]> on Fri, 23 May 2008 10:38:06 +0200, "delcour.pierre" <[EMAIL PROTECTED]> said: pierre.delcour> I wrote this not working code: pierre.delcour> BIO *bout = BIO_new(BIO_s_mem()); pierre.delcour> PEM_write_bio_PrivateKey(bout, key, NULL, NULL, 0, NULL, NULL); p

Re: [EVP_PKEY] How to duplicate it ?

2008-05-23 Thread Thomas Mangold
Why not just copy the key? EVP_PKEY *cp_key (EVP_PKEY *pkey) { /* error handling omittet */ EVP_PKEY *pnew; int key_type; pnew = EVP_PKEY_new(); switch(pkey->type) { case EVP_PKEY_RSA: DSA *dsa = EVP_PKEY_get1_DSA(pkey); EVP_PKEY_set1_DSA(pnew, dsa);

Re: EVP_Pkey serialize/desearileze from char

2006-11-28 Thread Nils Larsch
Marek Marcola wrote: Hello, I woud like my public key to be embedded in my source code as static char*, cause later I want to verify my licence with that key. x509 = PEM_read_X509(fp, NULL, NULL, NULL); pkey = X509_get_pubkey(x509); //Serialization for(i=0; i< sizeof(*pkey); i++){ fpri

Re: EVP_Pkey serialize/desearileze from char

2006-11-28 Thread Hős Attila
Thank you very much for you answer. I'll spared a lot of time with that, cause I was about to allocate dynamic memory for structure members :) Attila Marek Marcola wrote: Hello, I woud like my public key to be embedded in my source code as static char*, cause later I want to verify my li

Re: EVP_Pkey serialize/desearileze from char

2006-11-28 Thread Marek Marcola
Hello, > > I woud like my public key to be embedded in my source code > as static char*, cause later I want to verify my licence > with that key. > > x509 = PEM_read_X509(fp, NULL, NULL, NULL); > pkey = X509_get_pubkey(x509); > > //Serialization > for(i=0; i< sizeof(*pkey); i++){ > fprintf

Re: EVP_PKEY

2004-03-13 Thread Richard Levitte - VMS Whacker
In message <[EMAIL PROTECTED]> on Sat, 13 Mar 2004 05:11:27 -0800 (PST), "S.Mehdi Sheikhalishahi" <[EMAIL PROTECTED]> said: sm_justice> How can I get the RSA key of a EVP_PKEY. What version of OpenSSL? In OpenSSL 0.9.7{x}, there's the function EVP_PKEY_get1_RSA(). - Please consider sponso