OSH

AWS KMS setup

Keep the OSH - CA key in AWS KMS: create a P-256 signing key in your own AWS account, let the CA use only that key, check its fingerprint in OSH - CA and trust it on your servers.

Before you start

1. Before you start

AWS never exports the private key, but anyone who holds the AWS credentials the CA uses can ask AWS to sign. Give those credentials only the two permissions below, on this one key, and keep them on the CA machine.

With AWS KMS, the CA key lives in your own AWS account and the CA asks AWS to sign every certificate. The CA restarts without a PIN, and two CAs can share one key for failover. You need an AWS account, the AWS CLI, and network access from the CA machine to KMS: every certificate is one call to AWS, a few hundred milliseconds depending on your distance to the region.

OSH - CA Settings, CA Key: the Key Source menu open, each source with its own icon: YubiKey (PIV) under Hardware; AWS KMS and PKCS#11 / AWS CloudHSM, both tagged Cloud HSM, under Cloud; and File tagged Software under Software.

Create the key in AWS KMS

2. Create the key in AWS KMS

It must be an asymmetric signing key on the P-256 curve, not the default symmetric key. Create it in the region closest to the CA machine.

aws kms create-key --key-spec ECC_NIST_P256 --key-usage SIGN_VERIFY --description "OSH - CA" --region <region>

Note the KeyMetadata.Arn it prints, for example arn:aws:kms:<region>:<account>:key/<key-id>. OSH - CA needs the full ARN; an alias is refused.

Let the CA use only this key

3. Let the CA use only this key

Attach this policy to the AWS identity (IAM user or role) the CA runs as. The CA only ever reads the public key and signs; it needs no other KMS permission.

IAM policy for the CA
{  "Version": "2012-10-17",  "Statement": [{    "Effect": "Allow",    "Action": ["kms:GetPublicKey", "kms:Sign"],    "Resource": "arn:aws:kms:<region>:<account>:key/<key-id>"  }]}

Credentials: the CA reads them like any AWS client. OSH - CA started from the Dock, a LaunchAgent or a scheduled task does not see variables exported in your shell, so use a named profile (for example in ~/.aws/credentials) and enter its name in OSH - CA.

Behind a corporate proxy, set HTTPS_PROXY and NO_PROXY; keep the gateway host in NO_PROXY if the gateway must not go through the proxy.

Use the key in OSH - CA

4. Use the key in OSH - CA

Open OSH - CA, go to Settings → CA Key and choose AWS KMS as Key Source. Enter the key ARN and, if you use one, the AWS profile, then press Check key. OSH - CA reads the key from AWS and shows its fingerprint.

Choosing AWS KMS changes nothing yet: the CA keeps signing with its current key until you press Use this key.

OSH - CA Settings, CA Key: Key Source set to AWS KMS (cloud icon), its Setup guide and Compare options links, the Key ARN and AWS profile fields filled in, and a Check key button.

Check the fingerprint, then use the key

5. Check the fingerprint, then use the key

Before you press Use this key, work the fingerprint out from AWS yourself and compare it with the one OSH - CA shows. The screen alone would be trust on first sight. The command is also under How to verify in OSH - CA, with a Copy button.

aws kms get-public-key --key-id <arn> --region <region> --query PublicKey --output text | base64 -d | openssl pkey -pubin -inform DER -out k.pem && ssh-keygen -i -m PKCS8 -f k.pem > k.pub && ssh-keygen -lf k.pub

Prints SHA256:<base64>. OSH - CA shows the same key in both forms, SHA256:<base64> and SHA256:<hex>.

If they match, press Use this key and confirm. OSH - CA reads the key from AWS again, saves it only if AWS still answers the fingerprint you confirmed, and restarts with it.

Trust the CA on your servers

6. Trust the CA on your servers step by step

In OSH - CA press Copy public key line. It copies ecdsa-sha2-nistp256 followed by the key; pass only the key (the long text after the space) to the install script, as described in Trust the CA. The k.pub file from the previous step holds the same line.

Troubleshooting

7. Troubleshooting

"CA cannot sign — AWS KMS …": the credentials expired, the policy does not allow the key, the proxy is down or AWS cannot be reached. With a second CA set up (a different CA ID, it may use the same KMS key), gateway 0.34.0 or later moves to it in the meantime.

Deleting the KMS key is permanent and stops the CA for good (AWS only schedules the deletion after a waiting period, so cancel it in time if it was a mistake).

Cost: about US$1 per key per month plus a small fee per request. Check current AWS pricing.

© 2026 Open layer technologies L.L.C S.O.C · v0.1.0
Need help? ad@openlay.com