-
Notifications
You must be signed in to change notification settings - Fork 2
/
openssl.tmpl
211 lines (185 loc) · 10.1 KB
/
openssl.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
[ req ]
default_md = sha256
default_bits = 4096
distinguished_name = req_distinguished_name
string_mask = utf8only
[ ca ]
default_ca = CA_issue
[ policy_match ]
countryName = supplied
stateOrProvinceName = supplied
organizationName = match
organizationalUnitName = supplied
commonName = supplied
emailAddress = optional
[ policy_supplied ]
countryName = supplied
stateOrProvinceName = supplied
organizationName = supplied
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
[ policy_optional ]
countryName = optional
stateOrProvinceName = optional
localityName = optional
organizationName = optional
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
[ req_distinguished_name ]
# countryName = Country Name (2 letter code)
# countryName_min = 2
# countryName_max = 2
# countryName_default = XX
# stateOrProvinceName = State or Province Name (full name)
# stateOrProvinceName_default = My State
# localityName = Locality Name (city, district)
# localityName_default = My City
# 0.organizationName = Organization Name (company)
# 0.organizationName_default = My Company
# organizationalUnitName = Organizational Unit Name (department, division)
# organizationalUnitName_default = My Department
# emailAddress = Email Address
# emailAddress_max = 64
# emailAddress_default = nobody@localhost
commonName = Common Name
commonName_max = 64
commonName_default = localhost.localdomain
# include a prompt for alternative names…
# subjectAltName = Alternative DNS names (comma seperated list, e.g. DNS:localhost,DNS:localhost.localdomain)
# subjectAltName_default = DNS:myhost.com.au
[ CA_root ]
dir = /opt/root # Directory where everything is kept
certs = $dir/certs # Directory where the issued certs are kept
crl_dir = $dir/ # Directory where the issued crl are kept
database = $dir/ca/database.txt # database index file.
# unique_subject = no # Set to 'no' to allow creation of
# several certificates with same subject.
new_certs_dir = $dir/certs # Default directory for new certs.
certificate = $dir/ca.crt # The CA certificate
serial = $dir/ca/ca.serial # The current serial number
crlnumber = $dir/ca/crl.serial # The current crl number
crl = $dir/ca.crl # The current CRL
private_key = $dir/ca/private/ca.key # The private key
RANDFILE = $dir/ca/private/.rand # private random number file
x509_extensions = v3_intermediate # The extentions to add to the cert
name_opt = ca_default # Subject Name options
cert_opt = ca_default # Certificate field options
default_days = 3650 # how long to certify for
default_crl_days = 3650 # how long before next CRL
default_md = sha256 # use public key default MD
default_bits = 4096
preserve = no # keep passed DN ordering
email_in_dn = no # do not add Email Address to DN
copy_extensions = copy
policy = policy_match
[ CA_intermediate ]
dir = /opt/intermediate # Directory where everything is kept
certs = $dir/certs # Directory where the issued certs are kept
crl_dir = $dir/ # Directory where the issued crl are kept
database = $dir/ca/database.txt # database index file.
# unique_subject = no # Set to 'no' to allow creation of
# several certificates with same subject.
new_certs_dir = $dir/certs # Default directory for new certs.
certificate = $dir/ca.crt # The CA certificate
serial = $dir/ca/ca.serial # The current serial number
crlnumber = $dir/ca/crl.serial # The current crl number
crl = $dir/ca.crl # The current CRL
private_key = $dir/ca/private/ca.key # The private key
RANDFILE = $dir/ca/private/.rand # private random number file
x509_extensions = v3_issue # The extentions to add to the cert
name_opt = ca_default # Subject Name options
cert_opt = ca_default # Certificate field options
default_days = 3650 # how long to certify for
default_crl_days = 3650 # how long before next CRL
default_md = sha256 # use public key default MD
default_bits = 4096
preserve = no # keep passed DN ordering
email_in_dn = no # do not add Email Address to DN
copy_extensions = copy
policy = policy_supplied
[ CA_issue ]
dir = /opt/issue # Directory where everything is kept
certs = $dir/certs # Directory where the issued certs are kept
crl_dir = $dir/ # Directory where the issued crl are kept
database = $dir/ca/database.txt # database index file.
# unique_subject = no # Set to 'no' to allow creation of
# several certificates with same subject.
new_certs_dir = $dir/certs # Default directory for new certs.
certificate = $dir/ca.crt # The CA certificate
serial = $dir/ca/ca.serial # The current serial number
crlnumber = $dir/ca/crl.serial # The current crl number
crl = $dir/ca.crl # The current CRL
private_key = $dir/ca/private/ca.key # The private key
RANDFILE = $dir/ca/private/.rand # private random number file
x509_extensions = v3_client # The extentions to add to the cert
name_opt = ca_default # Subject Name options
cert_opt = ca_default # Certificate field options
default_days = 3650 # how long to certify for
default_crl_days = 3650 # how long before next CRL
default_md = sha256 # use public key default MD
default_bits = 4096
preserve = no # keep passed DN ordering
email_in_dn = no # do not add Email Address to DN
copy_extensions = copy
policy = policy_optional
[ v3_all ]
basicConstraints = critical, CA:TRUE
keyUsage = critical, digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment, cRLSign, keyCertSign
extendedKeyUsage = critical, serverAuth, clientAuth, codeSigning, emailProtection, timeStamping, OCSPSigning
nsComment = "Generated by jnovack/my-cert-authority [ v3_all ]"
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer
[ v3_root ]
basicConstraints = critical, CA:TRUE
keyUsage = critical, digitalSignature, cRLSign, keyCertSign
nsComment = "Generated by jnovack/my-cert-authority [ v3_root ]"
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer
[ v3_intermediate ]
basicConstraints = critical, CA:TRUE
keyUsage = critical, digitalSignature, cRLSign, keyCertSign
nsComment = "Generated by jnovack/my-cert-authority [ v3_intermediate ]"
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer
[ v3_issue ]
basicConstraints = critical, CA:TRUE, pathlen:0
keyUsage = critical, digitalSignature, cRLSign, keyCertSign
nsComment = "Generated by jnovack/my-cert-authority [ v3_issue ]"
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer
[ v3_service ]
basicConstraints = CA:FALSE
keyUsage = critical, digitalSignature, keyEncipherment
extendedKeyUsage = critical, serverAuth, clientAuth
nsComment = "Generated by jnovack/my-cert-authority [ v3_service ]"
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer
#subjectAltName = @san_custom
[ v3_server ]
basicConstraints = CA:FALSE
keyUsage = critical, digitalSignature, keyEncipherment
extendedKeyUsage = critical, serverAuth
nsComment = "Generated by jnovack/my-cert-authority [ v3_server ]"
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer
#subjectAltName = @san_custom
[ v3_client ]
basicConstraints = CA:FALSE
keyUsage = critical, digitalSignature, nonRepudiation, keyEncipherment
extendedKeyUsage = critical, clientAuth
nsComment = "Generated by jnovack/my-cert-authority [ v3_client ]"
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer
[ v3_user ]
basicConstraints = CA:FALSE
keyUsage = critical, digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
extendedKeyUsage = critical, clientAuth, codeSigning, emailProtection
nsComment = "Generated by jnovack/my-cert-authority [ v3_user ]"
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer
#[ san_custom ]
# Use subjectAltName = @san_custom under a v3_req section to enable.
#IP=127.0.0.1
#DNS=localhost