0

I'm using OpenSSl to encrypt and decrypt files based on CMS/SMIME. Normally I load certificates with rcert = PEM_read_bio_X509(tbio, NULL, 0, NULL); but this is only for PEM formatted files I guess. I haven't found any der.h header or something similar.

So is there a way in OpenSSL to load DER formatted certificates? I've found the load function for ASN1 format which uses OpenSSL intern.

if  (format == FORMAT_ASN1)
        x=d2i_X509_bio(cert,NULL);

But can that be used for DER which is binary?

Chris
  • 3,057
  • 5
  • 37
  • 63

1 Answers1

2

DER is indeed encoded using ASN.1, and the d2i_*() family of functions is the way to load a DER file.

caf
  • 233,326
  • 40
  • 323
  • 462