phpcertificateopensslverisign

PHP determine type of SSL certificate


I have certificate that can see in browser - signed by VeriSign - G3 But when I try to read with openSSL(or in PHP) like pkcs12 or x509 or pkcs7 - error like:

openssl pkcs12 -in cert.to.test.cer -clcerts -nokeys -out mycert.crt

28685:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:tasn_dec.c:1306:
28685:error:0D06C03A:asn1 encoding routines:ASN1_D2I_EX_PRIMITIVE:nested asn1 error:tasn_dec.c:830:
28685:error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error:tasn_dec.c:749:Field=version, Type=PKCS12

What can be done to read parameters of certificate in PHP? Thanks.


Solution

  • You can try

    openssl x509 -in certificate.der -inform der -text -noout
    

    May be it is DER encoded certificate