PKI---SELF(1)
πΈ PKI --SELF(1) πΈ
okay bestie, gather round, because we're diving into pki --self from the strongSwan manual, section 1 of the Unix manual pages. yes THAT strongSwan. she's iconic, she's giving certificate authority realness, and honestly? you're gonna eat this up π
β¨ NAME β¨
pki --self β Create a self-signed certificate π
like, a certificate that signs itself. main character energy fr fr, no CA needed, she validates her own existence π
β¨ SYNOPSIS β¨
pki --self [--in file|--keyid hex] [--type t] --dn distinguished-name
[--san subjectAltName] [--lifetime days] [--not-before datetime]
[--not-after datetime] [--serial hex] [--flag flag]
[--digest digest] [--rsa-padding padding] [--ca] [--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 --self --options file
pki --self -h | --help
three whole ways to run her, pick your fighter π«Ά
β¨ DESCRIPTION β¨
so this sub-command of pki(1) is literally just here to create a self-signed certificate. that's it. that's the whole vibe. one job, and she does it slayfully β
β¨ OPTIONS β¨
okay this is the long part, but stay with me, every single flag matters π₯
-h,--helpβ prints usage info with a lil summary of all the available options. your emotional support flag π«Ά-v,--debug levelβ sets the debug level. default:1. crank it up when things get mysterious π-+,--options fileβ reads command line options fromfile. yes the flag is literally-+. we love a quirky queen β¨-i,--in fileβ the private key input file. if you don't give her one, she reads the key from STDIN. no file? no problem, she'll wait π-x,--keyid hexβ smartcard or TPM private key object handle, in hex format, with an optional0xprefix. hardware girlies rise π-t,--type typeβ the type of the input key. eitherpriv,rsa,ecdsa,ed25519ored448. defaults toprivπ¦-d,--dn distinguished-nameβ the Subject and issuer distinguished name (DN). Required. like, non-negotiable, she will not run without it π-a,--san subjectAltNameβ thesubjectAltNameextension to include in the certificate. can be used multiple times, stack 'em up πΈ-l,--lifetime daysβ how many days the certificate is valid. default:1095. ignored if you give her both an absolute start and end time. she said pick a lane π-F,--not-before datetimeβ absolute time when the certificate's validity begins. the datetime format is defined by the--dateformoption β-T,--not-after datetimeβ absolute time when the certificate's validity ends. the datetime format is defined by the--dateformoption β-D,--dateform formβstrptime(3)format for the--not-beforeand--not-afteroptions. default:%d.%m.%y %Tπ-s,--serial hexβ serial number in hex. it's randomly allocated by default, so like, you don't HAVE to β¨-e,--flag flagβ adds an extendedKeyUsage flag. one ofserverAuth,clientAuth,crlSign, orocspSigning. can be used multiple times π-g,--digest digestβ the digest to use for signature creation. one ofmd5,sha1,sha224,sha256,sha384, orsha512. the default is determined based on the type and size of the signature key. she picks for you, trust her π-R,--rsa-padding paddingβ padding to use for RSA signatures. eitherpkcs1orpss, defaults topkcs1π§-f,--outform encodingβ encoding of the created certificate file. eitherder(ASN.1 DER) orpem(Base64 PEM), defaults toderπ¦-b,--caβ includes the CAbasicConstraintextension in the certificate. congrats, you're a CA now π-o,--ocsp uriβ OCSPAuthorityInfoAccessURI to include in the certificate. can be used multiple times π-p,--pathlen lenβ set the path length constraint π-B,--addrblock blockβ RFC 3779 address block to include in the certificate.blockis either a CIDR subnet (such as10.0.0.0/8) or an arbitrary address range (192.168.1.7-192.168.1.13). can be repeated to include multiple blocks. heads up though: 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 permittedNameConstraintextension to the certificate. for DNS or email constraints, the identity type is not always detectable by the given name β use thedns:oremail:prefix to force a constraint type π-N,--nc-excluded nameβ adds an excludedNameConstraintextension to the certificate. for DNS or email constraints, the identity type is not always detectable by the given name β use thedns:oremail:prefix to force a constraint type π-X,--critical oidβ adds a critical extension with the given OID. fancy π₯-M,--policy-mapping issuer-oid:subject-oidβ addspolicyMappingfrom issuer to subject OID π-E,--policy-explicit lenβ adds therequireExplicitPolicyconstraint β-H,--policy-inhibit lenβ adds theinhibitPolicyMappingconstraint β-A,--policy-any lenβ adds theinhibitAnyPolicyconstraint β
π Certificate Policy π
multiple certificatePolicy extensions can be added, bestie. plural! each one with the following info:
-P,--cert-policy oidβ OID to include in thecertificatePolicyextension. Required. π-C,--cps-uri uriβ Certification Practice statement URI forcertificatePolicyπ¦-U,--user-notice textβ user notice forcertificatePolicyπ
β¨ EXAMPLES β¨
generate a self-signed certificate using the given RSA key, like so:
pki --self --in key.der --dn "C=CH, O=strongSwan, CN=moon" \
--san moon.strongswan.org > cert.der
moon said "I'm the main character" and honestly? correct πβ¨
β¨ SEE ALSO β¨
pki(1) β go read the mothership page, iykyk π«Ά
and that's the whole page bestie!! version 6.1.0, dated 2019-05-06 β vintage but still slaying π go forth and self-sign something iconic π π
π¦ where this page comes from
- arch rolling: strongswan 6.1.0-2 Β· GPL-2.0-only
- nixos 26.05: strongswan 6.1.0
- nixpkgs unstable: strongswan 6.1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms