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.
136 .BI "\-n, \-\-nc-permitted " name
137 Add permitted NameConstraint extension to certificate. For DNS or email
138 constraints, the identity type is not always detectable by the given name. Use
143 prefix to force a constraint type.
145 .BI "\-N, \-\-nc-excluded " name
146 Add excluded 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 "\-M, \-\-policy-mapping " issuer-oid:subject-oid
155 Add policyMapping from issuer to subject OID.
157 .BI "\-E, \-\-policy-explicit " len
158 Add requireExplicitPolicy constraint.
160 .BI "\-H, \-\-policy-inhibit " len
161 Add inhibitPolicyMapping constraint.
163 .BI "\-A, \-\-policy-any " len
164 Add inhibitAnyPolicy constraint.
166 .SS "Certificate Policy"
167 Multiple certificatePolicy extensions can be added. Each with the following
170 .BI "\-P, \-\-cert-policy " oid
171 OID to include in certificatePolicy extension. Required.
173 .BI "\-C, \-\-cps-uri " uri
174 Certification Practice statement URI for certificatePolicy.
176 .BI "\-U, \-\-user-notice " text
177 User notice for certificatePolicy.
181 Generate a self-signed certificate using the given RSA key:
184 pki \-\-self \-\-in key.der \-\-dn "C=CH, O=strongSwan, CN=moon" \\
185 \-\-san moon.strongswan.org > cert.der