STRONGSWAN_PKI---ISSUE(1)

๐Ÿ“ฆ
version 6.0.7 ยท 4 versions
, in fedora 43, fedora 44

โœจ pki --issue โœจ

okay so bestie, welcome to the PKI --ISSUE(1) page ๐Ÿ’– this is the strongSwan corner of the world where we make certificates, and honestly? it's giving main character energy ๐Ÿ‘‘


๐ŸŒธ NAME ๐ŸŒธ

pki --issue โ€” Issue a certificate using a CA certificate and key ๐Ÿ’…


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

pki --issue [--in file] [--type type] --cakey file|--cakeyid hex
            --cacert file [--dn subject-dn] [--san subjectAltName]
            [--lifetime days] [--not-before datetime] [--not-
            after datetime] [--serial hex] [--flag flag]
            [--digest digest] [--rsa-padding padding] [--ca]
            [--crl uri [--crlissuer issuer]] [--ocsp uri]
            [--pathlen len] [--addrblock block] [--nc-permitted name]
            [--nc-excluded name] [--critical oid]
            [--policy-mapping mapping] [--policy-explicit len]
            [--policy-inhibit len] [--policy-any len]
            [--cert-policy oid [--cps-uri uri] [--user-notice text]]
            [--outform encoding] [--debug level]

pki --issue --options file

pki --issue -h | --help

๐Ÿ’œ DESCRIPTION ๐Ÿ’œ

So this is a sub-command of pki(1), and what it does is issue a certificate using a CA certificate and a private key ๐ŸŽ€ like, you bring the CA stuff, it hands you a shiny new cert. iconic behavior fr fr.


โœจ OPTIONS โœจ

  • -h, --help โ€” prints usage info plus a lil summary of all the options you can use ๐Ÿซถ
  • -v, --debug level โ€” sets the debug level, default is 1 ๐Ÿ›
  • -+, --options file โ€” reads your command line options from a file, so you don't gotta type forever ๐Ÿ“„
  • -i, --in file โ€” the public key or PKCS#10 certificate request file you wanna issue. If you don't give this, the key/request gets read from STDIN ๐Ÿ‘€
  • -t, --type type โ€” the type of the input. Pick one of pub (public key), priv (private key), rsa (RSA private key), ecdsa (ECDSA private key), ed25519 (Ed25519 private key), ed448 (Ed448 private key) or pkcs10 (PKCS#10 certificate request). Defaults to pub ๐Ÿ’ซ
  • -k, --cakey file โ€” the CA private key file. You need either this or --cakeyid, no skipping ๐Ÿ”‘
  • -x, --cakeyid hex โ€” smartcard or TPM CA private key object handle in hex format, with an optional 0x prefix. You need either this or --cakey ๐Ÿ”
  • -c, --cacert file โ€” the CA certificate file. Required. no cap, you literally can't skip this one โš ๏ธ
  • -d, --dn subject-dn โ€” the subject distinguished name (DN) of the certificate you're issuing ๐Ÿท๏ธ
  • -a, --san subjectAltName โ€” the subjectAltName extension to include in the cert. You can use this multiple times, stack 'em up ๐Ÿ’…
  • -l, --lifetime days โ€” how many days the certificate stays valid, default: 1095. It gets ignored if you give both an absolute start and end time โณ
  • -F, --not-before datetime โ€” the absolute time when the certificate's validity begins. The datetime format is defined by the --dateform option ๐Ÿ•ฐ๏ธ
  • -T, --not-after datetime โ€” the absolute time when the certificate's validity ends. The datetime format is defined by the --dateform option โŒ›
  • -D, --dateform form โ€” the strptime(3) format for the --not-before and --not-after options, default: %d.%m.%y %T ๐Ÿ“…
  • -s, --serial hex โ€” serial number in hex. It's randomly allocated by default, so if you don't care, the universe picks for you ๐ŸŽฒ
  • -e, --flag flag โ€” adds an extendedKeyUsage flag. One of serverAuth, clientAuth, crlSign, ocspSigning or msSmartcardLogon. Can be used multiple times. Without modifiers, this overrides flags from PKCS#10 certificate requests. Prefixing a flag with + adds it to the set of flags read from the request, prefixing it with - removes it from that set ๐Ÿšฉ
  • -g, --digest digest โ€” the digest to use for signature creation. One of md5, sha1, sha224, sha256, sha384, or sha512. The default is determined based on the type and size of the signature key ๐Ÿ”
  • -R, --rsa-padding padding โ€” the padding to use for RSA signatures. Either pkcs1 or pss, defaults to pkcs1 ๐Ÿงฑ
  • -f, --outform encoding โ€” the encoding of the created certificate file. Either der (ASN.1 DER) or pem (Base64 PEM), defaults to der ๐Ÿ“ฆ
  • -b, --ca โ€” includes the CA basicConstraint extension in the certificate ๐Ÿ‘‘
  • -u, --crl uri โ€” the CRL distribution point URI to include in the certificate. Can be used multiple times ๐Ÿ”—
  • -I, --crlissuer issuer โ€” optional CRL issuer for the CRL at the preceding distribution point ๐Ÿ“Œ
  • -o, --ocsp uri โ€” the OCSP AuthorityInfoAccess URI to include in the certificate. Can be used multiple times ๐ŸŒ
  • -p, --pathlen len โ€” sets the path length constraint ๐Ÿ“
  • -B, --addrblock block โ€” RFC 3779 address block to include in the certificate. block is either a CIDR subnet (such as 10.0.0.0/8) or an arbitrary address range (192.168.1.7-192.168.1.13). Can be repeated to include multiple blocks. Please note that the supplied blocks are included in the certificate as is, so for standards compliance, multiple blocks must be supplied in correct order and adjacent blocks must be combined. Refer to RFC 3779 for details ๐Ÿงฎ
  • -n, --nc-permitted name โ€” adds a permitted NameConstraint extension to the certificate. For DNS or email constraints, the identity type is not always detectable by the given name. Use the dns: or email: prefix to force a constraint type โœ…
  • -N, --nc-excluded name โ€” adds an excluded NameConstraint extension to the certificate. For DNS or email constraints, the identity type is not always detectable by the given name. Use the dns: or email: prefix to force a constraint type โŒ
  • -X, --critical oid โ€” adds a critical extension with the given OID ๐Ÿšจ
  • -M, --policy-mapping issuer-oid:subject-oid โ€” adds a policyMapping from issuer to subject OID ๐Ÿ—บ๏ธ
  • -E, --policy-explicit len โ€” adds a requireExplicitPolicy constraint ๐Ÿ“ข
  • -H, --policy-inhibit len โ€” adds an inhibitPolicyMapping constraint ๐Ÿ›‘
  • -A, --policy-any len โ€” adds an inhibitAnyPolicy constraint ๐Ÿšซ

๐ŸŽ€ Certificate Policy ๐ŸŽ€

You can add multiple certificatePolicy extensions. Each one carries the following info, bestie:

  • -P, --cert-policy oid โ€” OID to include in the certificatePolicy extension. Required. ๐Ÿ’–
  • -C, --cps-uri uri โ€” Certification Practice statement URI for the certificatePolicy ๐Ÿ“œ
  • -U, --user-notice text โ€” user notice for the certificatePolicy ๐Ÿ’ฌ

๐ŸŒˆ EXAMPLES ๐ŸŒˆ

To save on repetitive typing (the struggle is real ๐Ÿ˜ญ), command line options can be stored in files. Let's assume pki.opt contains the following contents:

--cacert ca_cert.der --cakey ca_key.der --digest sha256
--flag serverAuth --lifetime 1460 --type pkcs10

Then the following command can be used to issue a certificate based on a given PKCS#10 certificate request and the options above:

pki --issue --options pki.opt --in req.der > cert.der

slay. one line, whole cert. ๐Ÿ’…


โญ SEE ALSO โญ


and that's the whole page, bestie ๐Ÿซถ this was strongSwan version 6.0.7, dated 2019-05-06 โ€” go forth and issue those certificates, you absolute icon ๐Ÿ‘‘๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from