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
22 .OP \-\-rsa\-padding padding
26 .OP \-\-addrblock block
27 .OP \-\-nc-permitted name
28 .OP \-\-nc-excluded name
29 .OP \-\-policy\-mapping mapping
30 .OP \-\-policy\-explicit len
31 .OP \-\-policy\-inhibit len
32 .OP \-\-policy\-any len
33 .OP \-\-cert\-policy oid\ \fR[\fB\-\-cps\-uri\ \fIuri\fR]\ \fR[\fB\-\-user\-notice\ \fItext\fR]
34 .OP \-\-outform encoding
39 .BI \-\-options\~ file
52 is used to create a self-signed certificate.
58 Print usage information with a summary of the available options.
60 .BI "\-v, \-\-debug " level
61 Set debug level, default: 1.
63 .BI "\-+, \-\-options " file
64 Read command line options from \fIfile\fR.
66 .BI "\-i, \-\-in " file
67 Private key input file. If not given the key is read from \fISTDIN\fR.
69 .BI "\-x, \-\-keyid " hex
70 Smartcard or TPM private key object handle in hex format with an optional
73 .BI "\-t, \-\-type " type
74 Type of the input key. Either \fIpriv\fR, \fIrsa\fR, \fIecdsa\fR, \fIed25519\fR
75 or \fIbliss\fR, defaults to \fIpriv\fR.
77 .BI "\-d, \-\-dn " distinguished-name
78 Subject and issuer distinguished name (DN). Required.
80 .BI "\-a, \-\-san " subjectAltName
81 subjectAltName extension to include in certificate. Can be used multiple times.
83 .BI "\-l, \-\-lifetime " days
84 Days the certificate is valid, default: 1095. Ignored if both
85 an absolute start and end time are given.
87 .BI "\-F, \-\-not-before " datetime
88 Absolute time when the validity of the certificate begins. The datetime format
93 .BI "\-T, \-\-not-after " datetime
94 Absolute time when the validity of the certificate ends. The datetime format is
99 .BI "\-D, \-\-dateform " form
100 strptime(3) format for the
107 .BI "\-s, \-\-serial " hex
108 Serial number in hex. It is randomly allocated by default.
110 .BI "\-e, \-\-flag " flag
111 Add extendedKeyUsage flag. One of \fIserverAuth\fR, \fIclientAuth\fR,
112 \fIcrlSign\fR, or \fIocspSigning\fR. Can be used multiple times.
114 .BI "\-g, \-\-digest " digest
115 Digest to use for signature creation. One of \fImd5\fR, \fIsha1\fR,
116 \fIsha224\fR, \fIsha256\fR, \fIsha384\fR, or \fIsha512\fR. The default is
117 determined based on the type and size of the signature key.
119 .BI "\-R, \-\-rsa\-padding " padding
120 Padding to use for RSA signatures. Either \fIpkcs1\fR or \fIpss\fR, defaults
123 .BI "\-f, \-\-outform " encoding
124 Encoding of the created certificate file. Either \fIder\fR (ASN.1 DER) or
125 \fIpem\fR (Base64 PEM), defaults to \fIder\fR.
128 Include CA basicConstraint extension in certificate.
130 .BI "\-o, \-\-ocsp " uri
131 OCSP AuthorityInfoAccess URI to include in certificate. Can be used multiple
134 .BI "\-p, \-\-pathlen " len
135 Set path length constraint.
137 .BI "\-B, \-\-addrblock " block
138 RFC 3779 address block to include in certificate. \fIblock\fR is either a
139 CIDR subnet (such as \fI10.0.0.0/8\fR) or an arbitrary address range
140 (\fI192.168.1.7-192.168.1.13\fR). Can be repeated to include multiple blocks.
141 Please note that the supplied blocks are included in the certificate as is,
142 so for standards compliance, multiple blocks must be supplied in correct
143 order and adjacent blocks must be combined. Refer to RFC 3779 for details.
145 .BI "\-n, \-\-nc-permitted " name
146 Add permitted NameConstraint extension to certificate. For DNS or email
147 constraints, the identity type is not always detectable by the given name. Use
152 prefix to force a constraint type.
154 .BI "\-N, \-\-nc-excluded " name
155 Add excluded NameConstraint extension to certificate. For DNS or email
156 constraints, the identity type is not always detectable by the given name. Use
161 prefix to force a constraint type.
163 .BI "\-M, \-\-policy-mapping " issuer-oid:subject-oid
164 Add policyMapping from issuer to subject OID.
166 .BI "\-E, \-\-policy-explicit " len
167 Add requireExplicitPolicy constraint.
169 .BI "\-H, \-\-policy-inhibit " len
170 Add inhibitPolicyMapping constraint.
172 .BI "\-A, \-\-policy-any " len
173 Add inhibitAnyPolicy constraint.
175 .SS "Certificate Policy"
176 Multiple certificatePolicy extensions can be added. Each with the following
179 .BI "\-P, \-\-cert-policy " oid
180 OID to include in certificatePolicy extension. Required.
182 .BI "\-C, \-\-cps-uri " uri
183 Certification Practice statement URI for certificatePolicy.
185 .BI "\-U, \-\-user-notice " text
186 User notice for certificatePolicy.
190 Generate a self-signed certificate using the given RSA key:
193 pki \-\-self \-\-in key.der \-\-dn "C=CH, O=strongSwan, CN=moon" \\
194 \-\-san moon.strongswan.org > cert.der