aboutsummaryrefslogtreecommitdiff
path: root/server/testdata/x509/README.md
blob: c9f03def2ea9cda72c89354830ba1f7e415cdf2b (plain)
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
# Create new certificate chains
## Initial setup
```
$ touch index
$ echo 1000 > serial
```

## Root certificate
```
$ openssl genpkey -algorithm ed25519 -out root.key
$ openssl req -new -x509 -config ca.conf -extensions v3_ca -days 4096 -key root.key -out root.pem
$ openssl x509 -in root.pem -text -noout
```

## Intermediate certificate
```
$ openssl genpkey -algorithm ed25519 -out intermediate.key
$ openssl req -new -config ca.conf -extensions v3_intermediate_ca -key intermediate.key -out intermediate.csr
$ openssl ca -config ca.conf -extensions v3_intermediate_ca -days 4096 -in intermediate.csr -notext -out intermediate.pem
$ openssl x509 -in intermediate.pem -text -noout
```

## End-entity certificate
```
$ openssl genpkey -algorithm ed25519 -out end-entity.key
$ openssl req -new -key end-entity.key -out end-entity.csr
$ openssl x509 -req -days 4096 -CA intermediate.pem -CAkey intermediate.key -CAcreateserial -in end-entity.csr -out end-entity.pem
$ openssl x509 -in end-entity.pem -text -noout
```

## Make chain
```
$ cat end-entity.pem > chain.pem
$ cat intermediate.pem >> chain.pem
```