Is there openssl API to verify certificate content is DER or PEM format ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 10, 2015 at 08:48:41AM +0530, Nayna Jain wrote:

> I think I will try with PEM_read_xxx and d2i_, then probably do not have
> to read throu first character as 0x30.

That works, provided you rewind or re-open the file.

> Are all d2i_xxx type of APIs for DER format.

Yes, they decode binary ASN.1 encodings of the relevant structures.
And conversely i2d_... encodes a C structure to ASN.1 (typically
DER) form.
> 
> And if I have to operate on DER formatted certs, do I need to first convert
> it to PEM and then user PEM APIs. or there are DER specific APIs also, I
> didn't find though, unless they are d2i_xxx types.

I don't see why you would need to convert to PEM first, though
there are legitimate reasons to do so when you need to write
configuration files to disk, as PEM is easier to work with as a
configuration format.

-- 
	Viktor.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux