|
| 1 | +## Example [Quantum Resistant CA](https://angrysysadmins.tech/index.php/2022/09/grassyloki/step-ca-change-certificate-authority-and-intermediate-authority-encryption-type-and-key-size/) |
| 2 | + |
| 3 | +Generates: |
| 4 | + |
| 5 | +* **Root CA** with RSA `16384` bit certificate |
| 6 | +* **Intermediate CA** with RSA `8192` bit certificate |
| 7 | +* Use [higher container limits](https://github.com/smallstep/certificates/tree/master/examples/podman/stepca.container.md): `1` or `2` cores in testing below is ideal |
| 8 | +* `PodmanArgs=--memory 50m --cpus 1` |
| 9 | + |
| 10 | +--- |
| 11 | + |
| 12 | +* Get a shell in the container & regenerate certificates |
| 13 | +* `podman exec -it container_name /bin/bash` |
| 14 | + |
| 15 | +--- |
| 16 | +``` |
| 17 | +export root_bits=16384 |
| 18 | +export intermediate_bits=8192 |
| 19 | +``` |
| 20 | + |
| 21 | +## ROOT CA |
| 22 | + |
| 23 | +``` |
| 24 | +step certificate create 'My Root CA' \ |
| 25 | + $(step path)/certs/root_ca.crt \ |
| 26 | + $(step path)/secrets/root_ca_key \ |
| 27 | + --profile root-ca \ |
| 28 | + --kty RSA --size $root_bits \ |
| 29 | + --force |
| 30 | +``` |
| 31 | + |
| 32 | +8192 bits (root CA generation time) |
| 33 | +--- |
| 34 | +* 1 core = 1 min / 21 secs / 50 secs |
| 35 | + |
| 36 | +16384 bits (root CA generation time) |
| 37 | +--- |
| 38 | +* 8 cores = 3 mins / 12 mins |
| 39 | +* 3 cores = 14 mins |
| 40 | +* 2 cores = 3 mins / 6 mins / 7 mins / 9 mins / 11 mins / 13 mins |
| 41 | +* 1.5 cores = 8 mins / 29 mins |
| 42 | +* 1 core = 2 mins / 6 mins / 7.5 mins / 15 mins / 16.5 mins |
| 43 | +* 0.5 core = 9 mins / 23 mins |
| 44 | + |
| 45 | +## Intermediate CA |
| 46 | + |
| 47 | +``` |
| 48 | +step certificate create 'My Intermediate CA' \ |
| 49 | + $(step path)/certs/intermediate_ca.crt \ |
| 50 | + $(step path)/secrets/intermediate_ca_key \ |
| 51 | + --profile intermediate-ca \ |
| 52 | + --ca $(step path)/certs/root_ca.crt \ |
| 53 | + --ca-key $(step path)/secrets/root_ca_key \ |
| 54 | + --kty RSA --size $intermediate_bits \ |
| 55 | + --force |
| 56 | +``` |
| 57 | + |
| 58 | +8192 bits (intermediate CA generation time) |
| 59 | +--- |
| 60 | +* 2 core = 30 secs |
| 61 | +* 1 core = 25 secs |
| 62 | + |
| 63 | +--- |
| 64 | + |
| 65 | +* Restart the container & note the new X.509 Root Fingerprint: `podman logs container_name` |
| 66 | +* Boostsrap clients |
| 67 | + |
| 68 | +``` |
| 69 | +port=xxx |
| 70 | +
|
| 71 | +step ca bootstrap \ |
| 72 | + --ca-url https://ca.mydomain.com:$port \ |
| 73 | + --fingerprint 12345678abcdef12345678abcdef12345678abcdef12345678abcdef12345678 \ |
| 74 | + --context your_label \ |
| 75 | + --force |
| 76 | +``` |
| 77 | + |
| 78 | +--- |
| 79 | + |
| 80 | +* Contributed by: [Stuart Cardall](https://github.com/itoffshore) |
0 commit comments