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 Key ID of a private key on a smartcard.
71 .BI "\-t, \-\-type " type
72 Type of the input key. Either \fIpriv\fR, \fIrsa\fR, \fIecdsa\fR, \fIed25519\fR
73 or \fIbliss\fR, defaults to \fIpriv\fR.
75 .BI "\-d, \-\-dn " distinguished-name
76 Subject and issuer distinguished name (DN). Required.
78 .BI "\-a, \-\-san " subjectAltName
79 subjectAltName extension to include in certificate. Can be used multiple times.
81 .BI "\-l, \-\-lifetime " days
82 Days the certificate is valid, default: 1095. Ignored if both
83 an absolute start and end time are given.
85 .BI "\-F, \-\-not-before " datetime
86 Absolute time when the validity of the certificate begins. The datetime format
91 .BI "\-T, \-\-not-after " datetime
92 Absolute time when the validity of the certificate ends. The datetime format is
97 .BI "\-D, \-\-dateform " form
98 strptime(3) format for the
105 .BI "\-s, \-\-serial " hex
106 Serial number in hex. It is randomly allocated by default.
108 .BI "\-e, \-\-flag " flag
109 Add extendedKeyUsage flag. One of \fIserverAuth\fR, \fIclientAuth\fR,
110 \fIcrlSign\fR, or \fIocspSigning\fR. Can be used multiple times.
112 .BI "\-g, \-\-digest " digest
113 Digest to use for signature creation. One of \fImd5\fR, \fIsha1\fR,
114 \fIsha224\fR, \fIsha256\fR, \fIsha384\fR, or \fIsha512\fR. The default is
115 determined based on the type and size of the signature key.
117 .BI "\-f, \-\-outform " encoding
118 Encoding of the created certificate file. Either \fIder\fR (ASN.1 DER) or
119 \fIpem\fR (Base64 PEM), defaults to \fIder\fR.
122 Include CA basicConstraint extension in certificate.
124 .BI "\-o, \-\-ocsp " uri
125 OCSP AuthorityInfoAccess URI to include in certificate. Can be used multiple
128 .BI "\-p, \-\-pathlen " len
129 Set path length constraint.
131 .BI "\-B, \-\-addrblock " block
132 RFC 3779 address block to include in certificate. \fIblock\fR is either a
133 CIDR subnet (such as \fI10.0.0.0/8\fR) or an arbitrary address range
134 (\fI192.168.1.7-192.168.1.13\fR). Can be repeated to include multiple blocks.
135 Please note that the supplied blocks are included in the certificate as is,
136 so for standards compliance, multiple blocks must be supplied in correct
137 order and adjacent blocks must be combined. Refer to RFC 3779 for details.
139 .BI "\-n, \-\-nc-permitted " name
140 Add permitted NameConstraint extension to certificate. For DNS or email
141 constraints, the identity type is not always detectable by the given name. Use
146 prefix to force a constraint type.
148 .BI "\-N, \-\-nc-excluded " name
149 Add excluded NameConstraint extension to certificate. For DNS or email
150 constraints, the identity type is not always detectable by the given name. Use
155 prefix to force a constraint type.
157 .BI "\-M, \-\-policy-mapping " issuer-oid:subject-oid
158 Add policyMapping from issuer to subject OID.
160 .BI "\-E, \-\-policy-explicit " len
161 Add requireExplicitPolicy constraint.
163 .BI "\-H, \-\-policy-inhibit " len
164 Add inhibitPolicyMapping constraint.
166 .BI "\-A, \-\-policy-any " len
167 Add inhibitAnyPolicy constraint.
169 .SS "Certificate Policy"
170 Multiple certificatePolicy extensions can be added. Each with the following
173 .BI "\-P, \-\-cert-policy " oid
174 OID to include in certificatePolicy extension. Required.
176 .BI "\-C, \-\-cps-uri " uri
177 Certification Practice statement URI for certificatePolicy.
179 .BI "\-U, \-\-user-notice " text
180 User notice for certificatePolicy.
184 Generate a self-signed certificate using the given RSA key:
187 pki \-\-self \-\-in key.der \-\-dn "C=CH, O=strongSwan, CN=moon" \\
188 \-\-san moon.strongswan.org > cert.der