<html><body>
<p><font size="2" face="sans-serif">Hi,</font><br>
<br>
<font size="2" face="sans-serif">Thanks Victor, I am going to try these..</font><br>
<br>
<font size="2" face="sans-serif">I have similar concern for private key.</font><br>
<font size="2" face="sans-serif">If I have a pem file with private key in that, how do I check if that is RSA/DSA ?</font><br>
<br>
<font size="2" face="sans-serif">Thanks & Regards,<br>
Nayna Jain</font><br>
<br>
<img width="16" height="16" src="cid:1__=EABBF4F2DF9142C18f9e8a93df938@in.ibm.com" border="0" alt="Inactive hide details for Viktor Dukhovni ---06/10/2015 10:18:14 AM---On Wed, Jun 10, 2015 at 08:48:41AM +0530, Nayna Jain wrot"><font size="2" color="#424282" face="sans-serif">Viktor Dukhovni ---06/10/2015 10:18:14 AM---On Wed, Jun 10, 2015 at 08:48:41AM +0530, Nayna Jain wrote: > I think I will try with PEM_read_xxx a</font><br>
<br>
<font size="1" color="#5F5F5F" face="sans-serif">From:      </font><font size="1" face="sans-serif">Viktor Dukhovni <openssl-users@dukhovni.org></font><br>
<font size="1" color="#5F5F5F" face="sans-serif">To:        </font><font size="1" face="sans-serif">openssl-users@openssl.org, openssl-dev@openssl.org</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Date:      </font><font size="1" face="sans-serif">06/10/2015 10:18 AM</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Subject:   </font><font size="1" face="sans-serif">Re: [openssl-users] Is there openssl API to verify certificate content is DER or PEM format ?</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Sent by:   </font><font size="1" face="sans-serif">"openssl-users" <openssl-users-bounces@openssl.org></font><br>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>
<br>
<tt><font size="2">On Wed, Jun 10, 2015 at 08:48:41AM +0530, Nayna Jain wrote:<br>
<br>
> I think I will try with PEM_read_xxx and d2i_, then probably do not have<br>
> to read throu first character as 0x30.<br>
<br>
That works, provided you rewind or re-open the file.<br>
<br>
> Are all d2i_xxx type of APIs for DER format.<br>
<br>
Yes, they decode binary ASN.1 encodings of the relevant structures.<br>
And conversely i2d_... encodes a C structure to ASN.1 (typically<br>
DER) form.<br>
> <br>
> And if I have to operate on DER formatted certs, do I need to first convert<br>
> it to PEM and then user PEM APIs. or there are DER specific APIs also, I<br>
> didn't find though, unless they are d2i_xxx types.<br>
<br>
I don't see why you would need to convert to PEM first, though<br>
there are legitimate reasons to do so when you need to write<br>
configuration files to disk, as PEM is easier to work with as a<br>
configuration format.<br>
<br>
-- <br>
                 Viktor.<br>
_______________________________________________<br>
openssl-users mailing list<br>
To unsubscribe: </font></tt><tt><font size="2"><a href="https://mta.openssl.org/mailman/listinfo/openssl-users">https://mta.openssl.org/mailman/listinfo/openssl-users</a></font></tt><tt><font size="2"><br>
<br>
</font></tt><br>
</body></html>