Hi,

One simple and efficient method to distinguish between PEM and DER encoding for a CRL or a certificate is to read the first byte : if it's equal to 0x30 then this DER (this is the start of an ASN.1 Sequence) , otherwise it is PEM encoded. This works ONLY if you are sure that the given file is either PEM or DER encoded and that the encoded object is an ASN.1 Sequence.

Cheers,
--
Mounir IDRASSI
IDRIX
http://www.idrix.fr

On 6/3/2010 10:48 AM, Arunkumar Manickam wrote:
Hi,

Given a CRL file, how to detect its format. whether it is in PEM encoded
format or ASN1.

Thanks,
Arun


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to