Skip to content

Commit c50088b

Browse files
committed
Add keyspec for notional identity intermediate & docs to create it.
1 parent ac3138c commit c50088b

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"common_name": "Platform Identity Intermediate PVT1",
3+
"id":14,
4+
"algorithm":"Ecp384",
5+
"capabilities":"All",
6+
"domain":"DOM1",
7+
"hash":"Sha384",
8+
"label":"platform-identity-intermediate-pvt1",
9+
"purpose":"Identity",
10+
"initial_serial_number":"0000000000000000000000000000000000000000",
11+
"self_signed":false
12+
}

docs/intermediate.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# YubiHSM Provisioning Guide for PVT1 Programming
2+
3+
Perform the following steps to provision a YubiHSM for PVT1 programming.
4+
It's worth noting that the `offline-keystore` tool was designed for a specific purpose and this ain't it.
5+
It does however have all of the functionality we require, we just have to pass in additional options to override defaults that don't make sense when setting up an intermediate.
6+
7+
1. Reset your YubiHSM. There are a number of ways to do this:
8+
1. Follow the instructions from YubiCo to either reset the device with a physical mechanism as is required if you don’t know your password, or using the yubihsm-shel if you do: https://developers.yubico.com/YubiHSM2/Usage_Guides/Factory_reset.html
9+
1. The `offline-keystore` repo has a simple tool that can reset your password with fewer key presses than the `yubihsm-shell`. From the root of a `offline-keystore` git checkout: `cargo run --bin yhsm -- --auth-id X reset`. The `auth-id` option is used to pass in the object id of the auth credential. By default this is ‘1’ however the `oks` tool uses auth id ‘2’ instead.
10+
1. Checkout the `offline-keystore` repo: https://github.com/oxidecomputer/offline-keystore
11+
1. Initialize the YubiHSM:
12+
``` sh
13+
$ cargo run --bin oks -- hsm --no-backup initialize --passwd-challenge
14+
```
15+
NOTE: `--no-backup` disables the wrap key creation and splitting we do for the offline roots
16+
NOTE: `--passwd-challenge` disables the passwd mgmt flows we do for the offline roots & will challenge you for a password on the console. Pick a strong password, preferably one generated by a password manager and stored in same.
17+
1. Generate the identity signing key:
18+
```sh
19+
$ cargo run --bin oks -- \
20+
hsm --no-backup \
21+
generate \
22+
--key-spec data/platform-identity-intermediate.keyspec.json
23+
```
24+
NOTE: the keyspec file is checked into the `offline-keystore` repo
25+
1. Generate the directory structure and config file for the openssl CA:
26+
```sh
27+
$ cargo run --bin oks -- \
28+
ca initialize \
29+
--key-spec data/platform-identity-intermediate.keyspec.json
30+
```
31+
32+
## What happened?
33+
34+
At the end of all of this the HSM has:
35+
1. created an auth credential w/ a password set by the caller
36+
1. extracted the certificate for the attestation key on the YubiHSM: `output/hsm.attest.cert.pem`
37+
1. deleted the default auth credential created when the device was reset
38+
1. created a signing key per the provided keyspec, this will be the key used by our intermediate CA for signing certs
39+
1. collected an attestation by the YubiHSM proving the key created was created on this specific YubiHSM: `output/platform-identity-intermediate-pvt1.attest.cert.pem`
40+
1. created a directory structure and config as required by the `openssl ca` command using the YubiHSM as a signing back-end: `ca-state/platform-identity-intermediate-pvt1`
41+
1. created a CSR for the signing key such that it can be certified and included into an existing PKI: `output/platform-identity-intermediate-pvt1.csr.pem`

0 commit comments

Comments
 (0)