phpseclib: X.509 Decoder

The associative array returned by this page corresponds to the ASN.1 description of X.509 certificates.

Also, note that subjectPublicKey will not be decodable by OpenSSL as OpenSSL's rsautl function expects the public key to not only contain subjectPublicKey but also everything else in subjectPublicKeyInfo. ie. OpenSSL requires the public key explicitly identify it's using. Crypt_RSA can handle this format though and convert it if that's needed.

See ASN.1 Parser as well.

Copy / paste certificate:

Upload certificate:

$value) { $key = (string) $key; switch ($key) { case 'subjectPublicKey': $open = '
';
                    $close = '
'; break; case 'signature': $open = '
'; $close = '
'; break; default: $open = $close = ''; } $result.= '
  • ' . $key . '' . (is_array($value) ? array2html($value, false) : '
    • ' . $open . htmlspecialchars($value) . $close . '
    ') . '
  • '; } $start = $start ? ' class="printr"' : ''; return '' . $result . ''; } $x509 = new File_X509(); $cert = $x509->loadX509($cert); //echo '
    Subject: ' . $x509->getDN(true) . '
    '; //echo 'Issuer: ' . $x509->getIssuerDN(true) . '
    '; echo '
    Subject' . $x509->getDN(true) . '
    Issuer' . $x509->getIssuerDN(true) . '
    '; ?> $cert