Skip to content

Latest commit

 

History

History
118 lines (92 loc) · 3.05 KB

README-downloader.md

File metadata and controls

118 lines (92 loc) · 3.05 KB

ZeroSSL Download Converter

Download ZeroSSL certificates and save them directly in the required format.

Currently supported formats:

  • .crt
  • .cer
  • .pem
  • .der
  • .pfx (requires private key and password)
  • .p12 (requires private key and password)
  • .p12PKCS#12 (requires private key and password)

Use cases

Depending on what software you are using you might require your certificate in a different format than .crt (default). Using the downloader you can download a certificate directly in the required form.

Sample Usage

Basic usage:

php downloader.php --hash="CERTIFICATE_HASH" --apiKey="API_KEY" --formats=der --targetPath="/var/www"

Example usage with all options:

php downloader.php --hash="CERTIFICATE_HASH" --apiKey="API_KEY" --formats=crt,pem,cer,der,p12,pfx,p12PKCS#12 --targetPath="/var/www" --keyPath="/home/user/private.key" --keyPass="KEY_PASSWORD" --includeCrossSigned

Flags

" The flags should provide all configuration that you may ever need. Take a little time to fully understand what they are doing:

Flag Description Type Examples Required
-h,-hash ZeroSSL certificate hash (the certificate to be downloaded and converted). String 263f5da7524344266195a785279e72d6 yes
-a,--apiKey ZeroSSL API Key. You need to register at https://app.zerossl.com/signup to get an API key. String 663f5da7524344266195a785279e72d1 yes
-f,--formats A comma seperated string of formats you need for your certificate.

Note: If you want to create a PKCS12 format, which contains the private key, you have to pass private key and password from your local system. If your certificate has been generated with ZeroSSL, you can download the private key from the UI first. Your ZeroSSL password is the password for the private key.

String crt,der,p12 yes
-t,--targetPath The path in your local system where the converted certificate file(s) is/are saved. String /etc/ssl/ yes
-k,--keyPath The path including filename for your private key, which is only needed in certain conversion cases. String /home/user/private.key
-p,--keyPass Your private key password. Only use this option in a shell where this is secure (password might get saved e.g. in log files). String DoNotUseInsecurePasswords
-i,--includeCrossSigned Download and convert the cross-signed certificate if this is required. BOOLEAN

Usage as a library

Just have a look at downloader.php, implementation is quite straightforward.