extract-pem(1)

NAME
extract-pem - extracts blocks of PEM files into separate files

SYNOPSIS
extract-pem pem_file [...]
[-o file_name_prefix | - -output-prefix file_name_prefix]
[-1 | - -only-first-entry] [-f | - -skip-first-entry] [-l | - -skip-last-entry]
[-q | - -quiet]
extract-pem [-h | - -help]
extract-pem [-v | - -version]

DESCRIPTION
extract-pem extracts the blocks of PEM files into separate files. The output files will be named with a given output prefix (default: "output-"), and a sequential number according to the occurrence. The output file extension will be chosen based on the content:

* .crt for a certificate,

* .crl for a certificate revocation list (CRL),

* .key for a private key.

ARGUMENTS
The following options are available:

pem_file ...
    Specifies one or more PEM files to be extracted.

-o file_name_prefix | - -output-prefix file_name_prefix
    Sets the output file prefix (default: "output-").

-1 | - -only-first-entry
    Extract only the first entry (i.e. extract the certificate of e.g. a server itself, if the PEM file contains a chain of certificates).

-f | - -skip-first-entry
    Do not extract the first entry (i.e. do not extract the certificate of e.g. a server itself, if the PEM file contains a chain of certificates).

-l | - -skip-last-entry
    Do not extract the last entry (i.e. do not extract the certificate of the root CA, if the PEM file contains a chain of certificates).

-q | - -quiet
    Quiet mode: only print information in case of errors.

-h | - -help
    Prints the program's command-line parameters and exits.

-v | - -version
    Prints the program version and exits.

EXIT STATUS
The extract-pem tool exits with 0 on success, and >0 in case of an error.

EXAMPLES

extract-pem my-server-certificate.crt --output-prefix extract-

extract-pem my-server-certificate.crt -o extract-

extract-pem my-server-certificate.crt --skip-first-entry --skip-last-entry -o extract-intermediate-

extract-pem my-server-certificate.crt --only-first-entry -o extract-server-

extract-pem --help

extract-pem -h

extract-pem --version

extract-pem -v

SEE ALSO
check-certificate(1), der2pem(1), pem2der(1), test-tls-connection(1), view-certificate(1), view-crl(1), openssl(1)

NOTES
This program is part of System-Tools. The latest version of System-Tools can be found on the System-Tools Homepage at System-Tools Homepage: https://www.nntb.no/~dreibh/system-tools/.

AUTHORS
Thomas Dreibholz, Homepage: https://www.nntb.no/~dreibh