Creating a key
- Console
- API
- CLI
- Go
Go to KMS and choose Create Key. Under Key details
give it a Name and an optional Description; under Cryptography
pick a Key spec and a Key usage.The spec choices are AES-256 symmetric (recommended), RSA-2048
asymmetric, RSA-4096 asymmetric and ECDSA P-256 asymmetric (sign
only). Key usage is locked to whatever the chosen spec supports — an
RSA spec is the only one that lets you choose between Encrypt /
Decrypt and Sign / Verify.
enabled,
ready for crypto operations — there is nothing to poll.
name is unique per account and lands in the CRN, so it has to be URL-safe:
^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$.
The name is fixed after creation because IAM policies address the key by its
CRN. An update containing name returns a validation error, even when the
value is unchanged, empty or null. Existing keys retain their current names.
Deleting a key and reusing its name does not preserve the key’s identity or
cryptographic material.
Specs and usages
A key is pinned to one usage at creation: eitherencrypt_decrypt or
sign_verify. The spec decides which usages are even possible.
Omit
key_usage for aes-256 or ecdsa-p256 and the only usage the spec
supports is applied. Omit it for an RSA spec and the request is rejected — RSA
can do both, so the service will not guess.
Find a key
UseGET /v1/keys?name=prod-master for an exact, case-sensitive name match
within your account, or pass the key’s full CRN as the URL-encoded crn query
parameter. These filters combine with state and pagination. A malformed CRN
or one for another account, region or resource type returns an empty page.
