Skip to content

Commit 57fff3c

Browse files
AUTO: Sync Kubernetes docs to ScalarDB Enterprise docs site repo (#606)
Co-authored-by: josh-wong <[email protected]>
1 parent 595ffe1 commit 57fff3c

File tree

1 file changed

+4
-227
lines changed

1 file changed

+4
-227
lines changed

docs/scalar-kubernetes/HowToCreateKeyAndCertificateFiles.mdx

Lines changed: 4 additions & 227 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,15 @@ tags:
44
- Enterprise Premium
55
---
66

7-
# How to Create Private Key and Certificate Files for Scalar Products
7+
# How to Create Private Key and Certificate Files for TLS Connections in Scalar Products
88

9-
This guide explains how to create private key and certificate files for Scalar products.
9+
This guide explains how to create private key and certificate files for TLS connections in ScalarDB Cluster and ScalarDL. When you enable the TLS feature, you must prepare private key and certificate files.
1010

11-
## Private key and certificate files for TLS connections
12-
13-
ScalarDB Cluster and ScalarDL support TLS for each connection. When you enable the TLS feature, you must prepare private key and certificate files.
14-
15-
### Certificate requirements
11+
## Certificate requirements
1612

1713
* You can use only `RSA` or `ECDSA` as an algorithm for private key and certificate files.
1814

19-
### Example steps to create sample private key and certificate files
15+
## Example steps to create sample private key and certificate files
2016

2117
In this example, you'll create sample private key and certificate files by using `cfssl` and `cfssljson`. If you don't have those tools installed, please install `cfssl` and `cfssljson` to run this example.
2218

@@ -148,222 +144,3 @@ In this example, you'll create sample private key and certificate files by using
148144
* `server-key.pem` is the private key file.
149145
* `server.pem` is the certificate file.
150146
* `ca.pem` is the root CA certificate file.
151-
152-
## Private key and certificate files for `digital-signature` authentication (ScalarDL)
153-
154-
ScalarDL has several kinds of authentication methods. If you use `digital-signature` as an authentication method, you must prepare private key and certificate files. For more details on the authentication method, see [ScalarDL Authentication Guide](https://scalardl.scalar-labs.com/docs/latest/authentication/).
155-
156-
### Certificate requirements
157-
158-
* You must use `ECDSA` as an algorithm of private key and certificate files.
159-
* You must use `P-256` as a curve parameter.
160-
* You must use `SHA256` as a hash function.
161-
162-
### Example steps to create sample private key and certificate files
163-
164-
You can create sample private key and certificate files by using [`cfssl` and `cfssljson`](https://github.com/cloudflare/cfssl). Please install `cfssl` and `cfssljson` first if you don't install them yet.
165-
166-
:::note
167-
168-
* You can use other tools, like `openssl`, to create the private key and certificate files. Alternatively, you can ask a third-party CA or the administrator of your private CA to create the private key and certificate for your production environment.
169-
* This example creates a self-signed certificate. However, it is strongly recommended that these certificates **not** be used in production. Please ask trusted issuers (a public CA or your private CA) to create certificate files for your production environment based on your security requirements.
170-
171-
:::
172-
173-
1. Create a working directory.
174-
175-
```console
176-
mkdir -p ${HOME}/scalardl/digital-signature/certs/
177-
```
178-
179-
1. Change the working directory to `${HOME}/scalardl/digital-signature/certs/`.
180-
181-
```console
182-
cd ${HOME}/scalardl/digital-signature/certs/
183-
```
184-
185-
1. Create a JSON file that includes CA information.
186-
187-
```console
188-
cat << 'EOF' > ${HOME}/scalardl/digital-signature/certs/ca.json
189-
{
190-
"CN": "scalardl-example-ca",
191-
"key": {
192-
"algo": "ecdsa",
193-
"size": 256
194-
},
195-
"names": [
196-
{
197-
"C": "JP",
198-
"ST": "Tokyo",
199-
"L": "Shinjuku",
200-
"O": "ScalarDL Example CA"
201-
}
202-
]
203-
}
204-
EOF
205-
```
206-
207-
1. Create the CA private key and certificate files.
208-
209-
```console
210-
cfssl gencert -initca ca.json | cfssljson -bare ca
211-
```
212-
213-
1. Create a JSON file that includes CA configurations.
214-
215-
```console
216-
cat << 'EOF' > ${HOME}/scalardl/digital-signature/certs/ca-config.json
217-
{
218-
"signing": {
219-
"default": {
220-
"expiry": "87600h"
221-
},
222-
"profiles": {
223-
"scalardl-example-ca": {
224-
"expiry": "87600h",
225-
"usages": [
226-
"signing",
227-
"key encipherment",
228-
"server auth"
229-
]
230-
}
231-
}
232-
}
233-
}
234-
EOF
235-
```
236-
237-
1. Create a JSON file that includes client information.
238-
239-
```console
240-
cat << 'EOF' > ${HOME}/scalardl/digital-signature/certs/client.json
241-
{
242-
"CN": "scalardl-client",
243-
"hosts": [
244-
"client.scalardl.example.com",
245-
"localhost"
246-
],
247-
"key": {
248-
"algo": "ecdsa",
249-
"size": 256
250-
},
251-
"names": [
252-
{
253-
"C": "JP",
254-
"ST": "Tokyo",
255-
"L": "Shinjuku",
256-
"O": "ScalarDL Client Example"
257-
}
258-
]
259-
}
260-
EOF
261-
```
262-
263-
1. Create a JSON file that includes ScalarDL Ledger information.
264-
265-
```console
266-
cat << 'EOF' > ${HOME}/scalardl/digital-signature/certs/ledger.json
267-
{
268-
"CN": "scalardl-ledger",
269-
"hosts": [
270-
"ledger.scalardl.example.com",
271-
"localhost"
272-
],
273-
"key": {
274-
"algo": "ecdsa",
275-
"size": 256
276-
},
277-
"names": [
278-
{
279-
"C": "JP",
280-
"ST": "Tokyo",
281-
"L": "Shinjuku",
282-
"O": "ScalarDL Ledger Example"
283-
}
284-
]
285-
}
286-
EOF
287-
```
288-
289-
1. Create a JSON file that includes ScalarDL Auditor information.
290-
291-
```console
292-
cat << 'EOF' > ${HOME}/scalardl/digital-signature/certs/auditor.json
293-
{
294-
"CN": "scalardl-auditor",
295-
"hosts": [
296-
"auditor.scalardl.example.com",
297-
"localhost"
298-
],
299-
"key": {
300-
"algo": "ecdsa",
301-
"size": 256
302-
},
303-
"names": [
304-
{
305-
"C": "JP",
306-
"ST": "Tokyo",
307-
"L": "Shinjuku",
308-
"O": "ScalarDL Auditor Example"
309-
}
310-
]
311-
}
312-
EOF
313-
```
314-
315-
1. Create the private key and certificate files for the client.
316-
317-
```console
318-
cfssl gencert -ca ca.pem -ca-key ca-key.pem -config ca-config.json -profile scalardl-example-ca client.json | cfssljson -bare client
319-
```
320-
321-
1. Create the private key and certificate files for ScalarDL Ledger.
322-
323-
```console
324-
cfssl gencert -ca ca.pem -ca-key ca-key.pem -config ca-config.json -profile scalardl-example-ca ledger.json | cfssljson -bare ledger
325-
```
326-
327-
1. Create the private key and certificate files for ScalarDL Auditor.
328-
329-
```console
330-
cfssl gencert -ca ca.pem -ca-key ca-key.pem -config ca-config.json -profile scalardl-example-ca auditor.json | cfssljson -bare auditor
331-
```
332-
333-
1. Confirm that the private key and certificate files were created.
334-
335-
```console
336-
ls -1
337-
```
338-
339-
[Command execution result]
340-
341-
```console
342-
auditor-key.pem
343-
auditor.csr
344-
auditor.json
345-
auditor.pem
346-
ca-config.json
347-
ca-key.pem
348-
ca.csr
349-
ca.json
350-
ca.pem
351-
client-key.pem
352-
client.csr
353-
client.json
354-
client.pem
355-
ledger-key.pem
356-
ledger.csr
357-
ledger.json
358-
ledger.pem
359-
```
360-
361-
In this case:
362-
363-
* `client-key.pem` is the private key file for the client.
364-
* `client.pem` is the certificate file for the client.
365-
* `ledger-key.pem` is the private key file for ScalarDL Ledger.
366-
* `ledger.pem` is the certificate file for ScalarDL Ledger.
367-
* `auditor-key.pem` is the private key file for ScalarDL Auditor.
368-
* `auditor.pem` is the certificate file for ScalarDL Auditor.
369-
* `ca.pem` is the root CA certificate file.

0 commit comments

Comments
 (0)