CA.PL(1ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

okay so this is the CA.PL(1ossl) manual page and bestie, if you've ever stared at OpenSSL cert commands like they were a cryptic group chat you got added to by accident β€” this is the glow-up you needed πŸ’…βœ¨

πŸŽ€ NAME πŸŽ€

CA.pl β€” a friendlier interface for OpenSSL certificate programs 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

CA.pl -? | -h | -help

CA.pl -newcert | -newreq | -newreq-nodes | -xsign | -sign | -signCA |
-signcert | -crl | -newca [-extra-cmd parameter]

CA.pl -pkcs12 [certname]

CA.pl -verify certfile ...

CA.pl -revoke certfile [reason]

🌸 DESCRIPTION 🌸

So CA.pl is a perl script that hands the openssl(1) command all the relevant command line arguments for a bunch of common certificate operations. The whole vibe is: make certificate creation and management less of a nightmare by giving you some simple options to work with πŸ’–

It's lowkey designed as a simple front end for openssl(1), meant for beginners. But real talk β€” its behaviour isn't always what you want. If you need more control over what the certificate commands are doing, just call openssl(1) directly, no hard feelings 🫢

Most of the filenames mentioned below can be changed by editing the CA.pl script itself.

Also, heads up πŸ™ˆ β€” in some environments (looking at you, Win32) you might not be able to run the CA.pl script directly, and the default configuration file location may be wrong. In that case, run:

perl -S CA.pl

and set the OPENSSL_CONF environment variable to point at the correct path of the configuration file. Slay, problem solved ✨


✨ OPTIONS ✨

  • -?, -h, -help β€” prints a usage message. That's it, that's the whole job πŸ’…
  • -newcert β€” creates a brand new self signed certificate. The private key goes into the file newkey.pem and the request goes into the file newreq.pem. It invokes openssl-req(1) under the hood πŸ”₯
  • -newreq β€” creates a new certificate request. Private key ➑️ newkey.pem, request ➑️ newreq.pem. Executes openssl-req(1) behind the scenes πŸŽ€
  • -newreq-nodes β€” literally -newreq except the private key will not be encrypted. Uses openssl-req(1) πŸ™ˆ
  • -newca β€” creates a whole new CA hierarchy for use with the ca program (or the -signcert and -xsign options). You get prompted to enter the filename of the CA certificates (which should also contain the private key), or if you just hit ENTER you'll be prompted for the details of the CA instead. The relevant files and directories get created in a directory called demoCA in the current directory. Uses openssl-req(1) and openssl-ca(1). πŸ‘‘
⚠️ If the demoCA directory already exists, the -newca command will not overwrite it and will do nothing. This can happen if a previous call using the -newca option terminated abnormally. To get the correct behaviour, delete the directory if it already exists. Not me warning you twice πŸ’€
  • -pkcs12 β€” creates a PKCS#12 file containing the user certificate, private key and CA certificate. It expects the user certificate and private key to be in the file newcert.pem and the CA certificate to be in the file demoCA/cacert.pem, and it creates a file newcert.p12. So you can call this after the -sign option. The PKCS#12 file can be imported directly into a browser 🧚 If there's an extra argument on the command line, it's used as the "friendly name" for the certificate (which is typically displayed in the browser list box), otherwise the name "My Certificate" is used. It delegates all the work to openssl-pkcs12(1) ✨
  • -sign, -signcert, -xsign β€” calls the openssl-ca(1) command to sign a certificate request. Expects the request to be in the file newreq.pem. The new certificate gets written to the file newcert.pem β€” except with the -xsign option, where it's written to standard output πŸ–¨οΈ
  • -signCA β€” same as the -sign option, except it uses the configuration file section v3_ca, so it makes the signed request a valid CA certificate. Super useful when you're creating an intermediate CA from a root CA πŸ‘‘ Extra params are passed to openssl-ca(1).
  • -signcert β€” same as -sign, except it expects a self signed certificate to be present in the file newreq.pem. Extra params are passed to openssl-x509(1) and openssl-ca(1).
  • -crl β€” generates a CRL. Executes openssl-ca(1) πŸ—’οΈ
  • -revoke certfile [reason] β€” revokes the certificate contained in the specified certfile. An optional reason may be specified, and it must be one of: unspecified, keyCompromise, CACompromise, affiliationChanged, superseded, cessationOfOperation, certificateHold, or removeFromCRL. Leverages openssl-ca(1) πŸ’€
  • -verify β€” verifies certificates against the CA certificate for demoCA. If no certificates are specified on the command line, it tries to verify the file newcert.pem. Invokes openssl-verify(1) βœ…
  • -extra-cmd parameter β€” for each option extra-cmd, passes parameter to the openssl(1) sub-command with the same name as cmd, if that sub-command is invoked. For example, if openssl-req(1) is invoked, the parameter given with -extra-req will be passed to it. For multi-word parameters, either repeat the option or quote the parameters so it looks like one word to your shell. See the individual command documentation for more information πŸ“š

🌈 EXAMPLES 🌈

Create a CA hierarchy β€” easy:

CA.pl -newca

Complete certificate creation example, aka the full main character arc ✨ create a CA, create a request, sign the request, and finally create a PKCS#12 file containing it:

CA.pl -newca
CA.pl -newreq
CA.pl -sign
CA.pl -pkcs12 "My Test Certificate"

πŸ“ ENVIRONMENT πŸ“

The environment variable OPENSSL can be used to specify the name of the OpenSSL program. It can be a full pathname, or a relative one πŸ›£οΈ

The environment variable OPENSSL_CONFIG can be used to specify a configuration option and value to the req and ca commands invoked by this script. Its value should be the option and pathname, like this:

"-config /path/to/conf-file"

πŸ’œ SEE ALSO πŸ’œ

openssl(1), openssl-x509(1), openssl-ca(1), openssl-req(1), openssl-pkcs12(1), config(5) β€” go read them, iykyk πŸ¦‹


Copyright 2000-2025 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


okay that's the whole page bestie, you ate that 🫢✨ this was CA.PL(1ossl) from OpenSSL version 3.5.0, dated 2026-09-25 β€” go forth and certify, no cap πŸ’…πŸŽ€

πŸ“¦ where this page comes from