On Fri, Nov 18, 2005, Robin Hughes wrote:
>
>
> Am I misunderstanding something about the
> compatibility of "-outform DER" with
> d2i_RSAPublicKey??
>
Yes, the formats are incompatible. You need d2i_RSA_PUBKEY() instead.
Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepag
< 0)
/* error */
But i think you have to free the memory using OPENSSSL_free().
Regards,
fred
-Original Message-
From: Edward Chan [mailto:[EMAIL PROTECTED]
Sent: Thu 7/21/2005 8:08 PM
To: openssl-users@openssl.org
Cc:
Subject: RE: d2i_RSAPublicKey doesn
Horray...that is it. Thanks!!!
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Edward Chan
> Sent: Thursday, July 21, 2005 11:00 AM
> To: openssl-users@openssl.org
> Subject: RE: d2i_RSAPublicKey doesn't work
>
> S
On Thu, Jul 21, 2005, Edward Chan wrote:
> So I need to save buf to a tmp first like with d2i_RSAPublicKey?
>
> Like this:
>
> int len = i2d_RSAPublicKey(rsa, 0);
> unsigned char* buf = new unsigned char[len];
> unsigned char* tmp = buf;
> i2d_RSAPublicKey(rsa, &tmp);
>
> // now use buf to dec
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Dr.
> Stephen Henson
> Sent: Thursday, July 21, 2005 10:23 AM
> To: openssl-users@openssl.org
> Subject: Re: d2i_RSAPublicKey doesn't work
>
> On Thu, Jul 21, 2005, Edward Chan wrote:
&g
On Thu, Jul 21, 2005, Edward Chan wrote:
> The code is basically like this:
>
> int len = i2d_RSAPublicKey(rsa, 0);
>
> // allocate buffer
> unsigned char* buf = new unsigned char[len];
>
> // now call again to DER encode the public key
> if (i2d_RSAPublicKey(rsa,
turns me null back.
Does the code look right?
Thanks,
Ed
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Dr.
> Stephen Henson
> Sent: Thursday, July 21, 2005 4:12 AM
> To: openssl-users@openssl.org
> Subject: Re: d2i_RSAPu
On Wed, Jul 20, 2005, Edward Chan wrote:
> Hmm, well, I guess I assumed i2d_RSAPublicKey() was ok since the RSA key
> seems fine (I ran RSA_check_key() on it and it says it is ok). Is there
> any reason why i2d_RSAPublicKey() would not be returning me valid data?
>
Normally only if it is not ca
rect?
Thanks,
Ed
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Dr.
> Stephen Henson
> Sent: Wednesday, July 20, 2005 5:48 PM
> To: openssl-users@openssl.org
> Subject: Re: d2i_RSAPublicKey doesn't work
>
On Tue, Jul 19, 2005, Edward Chan wrote:
> That part of the code remains the same, and continues to work fine. By
> the way, my last code snippet should have been:
>
> U8* tmp = buf;
> RSA* pub = d2i_RSAPublicKey(0, (const U8**)&tmp, len);
>
> I mistakenly typed *len instead of len.
>
> Anywa
PROTECTED] On Behalf Of Nils Larsch
> Sent: Tuesday, July 19, 2005 12:36 AM
> To: openssl-users@openssl.org
> Subject: Re: d2i_RSAPublicKey doesn't work
>
> Edward Chan wrote:
> > If you're referring to http://www.openssl.org/support/faq.html
> >
> >
Edward Chan wrote:
If you're referring to http://www.openssl.org/support/faq.html
3. How do I read or write a DER encoded buffer using the ASN1 functions?
...
The opposite assumes we already have len bytes in buf:
unsigned char *p;
p = buf;
p7 = d2i_PKCS7(NULL, &p, len);
At this point p7
essage-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Nils Larsch
> Sent: Monday, July 18, 2005 1:10 PM
> To: openssl-users@openssl.org
> Subject: Re: d2i_RSAPublicKey doesn't work
>
> Edward Chan wrote:
> > What am I doing wrong here? I
Edward Chan wrote:
What am I doing wrong here? I generate an RSA key. Then I DER encode
it. Then try to decode it, but the decode fails. The error says,
"error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long"
RSA* rsa = RSA_generate_key(2048, RSA_F4, 0, 0);
if (rsa)
{
Rafa Marín López wrote:
> Hello.
Hi.
>
> RSA * d2i_RSAPublicKey(RSA **a, unsigned char **pp, long length);
>
> What does length param mean?
length is the length of the *pp data, that means it is the number of bytes that you
want to convert from DER to internal form, starting at location *pp.
15 matches
Mail list logo