1 .TH "PKI \-\-SELF" 1 "2016-12-13" "@PACKAGE_VERSION@" "strongSwan"
5 pki \-\-self \- Create a self-signed certificate
11 .IR file | \fB\-\-keyid\fR
14 .BI \-\-dn\~ distinguished-name
15 .OP \-\-san subjectAltName
17 .OP \-\-not-before datetime
18 .OP \-\-not-after datetime
25 .OP \-\-addrblock block
26 .OP \-\-nc-permitted name
27 .OP \-\-nc-excluded name
28 .OP \-\-policy\-mapping mapping
29 .OP \-\-policy\-explicit len
30 .OP \-\-policy\-inhibit len
31 .OP \-\-policy\-any len
32 .OP \-\-cert\-policy oid\ \fR[\fB\-\-cps\-uri\ \fIuri\fR]\ \fR[\fB\-\-user\-notice\ \fItext\fR]
33 .OP \-\-outform encoding
38 .BI \-\-options\~ file
51 is used to create a self-signed certificate.
57 Print usage information with a summary of the available options.
59 .BI "\-v, \-\-debug " level
60 Set debug level, default: 1.
62 .BI "\-+, \-\-options " file
63 Read command line options from \fIfile\fR.
65 .BI "\-i, \-\-in " file
66 Private key input file. If not given the key is read from \fISTDIN\fR.
68 .BI "\-x, \-\-keyid " hex
69 Smartcard or TPM private key object handle in hex format with an optional
72 .BI "\-t, \-\-type " type
73 Type of the input key. Either \fIpriv\fR, \fIrsa\fR, \fIecdsa\fR, \fIed25519\fR
74 or \fIbliss\fR, defaults to \fIpriv\fR.
76 .BI "\-d, \-\-dn " distinguished-name
77 Subject and issuer distinguished name (DN). Required.
79 .BI "\-a, \-\-san " subjectAltName
80 subjectAltName extension to include in certificate. Can be used multiple times.
82 .BI "\-l, \-\-lifetime " days
83 Days the certificate is valid, default: 1095. Ignored if both
84 an absolute start and end time are given.
86 .BI "\-F, \-\-not-before " datetime
87 Absolute time when the validity of the certificate begins. The datetime format
92 .BI "\-T, \-\-not-after " datetime
93 Absolute time when the validity of the certificate ends. The datetime format is
98 .BI "\-D, \-\-dateform " form
99 strptime(3) format for the
106 .BI "\-s, \-\-serial " hex
107 Serial number in hex. It is randomly allocated by default.
109 .BI "\-e, \-\-flag " flag
110 Add extendedKeyUsage flag. One of \fIserverAuth\fR, \fIclientAuth\fR,
111 \fIcrlSign\fR, or \fIocspSigning\fR. Can be used multiple times.
113 .BI "\-g, \-\-digest " digest
114 Digest to use for signature creation. One of \fImd5\fR, \fIsha1\fR,
115 \fIsha224\fR, \fIsha256\fR, \fIsha384\fR, or \fIsha512\fR. The default is
116 determined based on the type and size of the signature key.
118 .BI "\-f, \-\-outform " encoding
119 Encoding of the created certificate file. Either \fIder\fR (ASN.1 DER) or
120 \fIpem\fR (Base64 PEM), defaults to \fIder\fR.
123 Include CA basicConstraint extension in certificate.
125 .BI "\-o, \-\-ocsp " uri
126 OCSP AuthorityInfoAccess URI to include in certificate. Can be used multiple
129 .BI "\-p, \-\-pathlen " len
130 Set path length constraint.
132 .BI "\-B, \-\-addrblock " block
133 RFC 3779 address block to include in certificate. \fIblock\fR is either a
134 CIDR subnet (such as \fI10.0.0.0/8\fR) or an arbitrary address range
135 (\fI192.168.1.7-192.168.1.13\fR). Can be repeated to include multiple blocks.
136 Please note that the supplied blocks are included in the certificate as is,
137 so for standards compliance, multiple blocks must be supplied in correct
138 order and adjacent blocks must be combined. Refer to RFC 3779 for details.
140 .BI "\-n, \-\-nc-permitted " name
141 Add permitted NameConstraint extension to certificate. For DNS or email
142 constraints, the identity type is not always detectable by the given name. Use
147 prefix to force a constraint type.
149 .BI "\-N, \-\-nc-excluded " name
150 Add excluded NameConstraint extension to certificate. For DNS or email
151 constraints, the identity type is not always detectable by the given name. Use
156 prefix to force a constraint type.
158 .BI "\-M, \-\-policy-mapping " issuer-oid:subject-oid
159 Add policyMapping from issuer to subject OID.
161 .BI "\-E, \-\-policy-explicit " len
162 Add requireExplicitPolicy constraint.
164 .BI "\-H, \-\-policy-inhibit " len
165 Add inhibitPolicyMapping constraint.
167 .BI "\-A, \-\-policy-any " len
168 Add inhibitAnyPolicy constraint.
170 .SS "Certificate Policy"
171 Multiple certificatePolicy extensions can be added. Each with the following
174 .BI "\-P, \-\-cert-policy " oid
175 OID to include in certificatePolicy extension. Required.
177 .BI "\-C, \-\-cps-uri " uri
178 Certification Practice statement URI for certificatePolicy.
180 .BI "\-U, \-\-user-notice " text
181 User notice for certificatePolicy.
185 Generate a self-signed certificate using the given RSA key:
188 pki \-\-self \-\-in key.der \-\-dn "C=CH, O=strongSwan, CN=moon" \\
189 \-\-san moon.strongswan.org > cert.der