document.write("

Export all certificates into one file

\n
$ base64 -d <P7B_FILE>.p7b | openssl pkcs7 -inform DER -print_certs -out <PEM_FILE>.pem\n
\n

We'll get three certificates inside <PEM_FILE>.pem file, from top to bottom:

\n
    \n
  1. Certificate for the route in PEM format
  2. \n
  3. CA certificate chain for the route validation in PEM format
  4. \n
  5. Root CA certificate in PEM format
  6. \n
\n

Validate key - certificate pair with following commands

\n
$ openssl pkey -in <PRIVATE>.key -pubout -outform pem | sha256sum\n
\n

Example output: bb912b1c6614a0462556b2826b7dce6083a9b58049008a656706234d45abd4c6

\n
$ openssl x509 -in <ROOT_CA>.cer -pubkey -noout -outform pem | sha256sum\n
\n

Example output: bb912b1c6614a0462556b2826b7dce6083a9b58049008a656706234d45abd4c6

\n
HOWTO.md - Snippet hosted by \"Cacher\"
");