Skip to content

af kms

Manage the organization's encryption and signing keys

Each key lists who may use it, and how: full use, or encrypt-only (verify-only for a signing key). Data is encrypted, decrypted and signed by the forge. Creating or changing a key, and changing who may use it, are requests that need approval.

Usage

af kms [OPTIONS] <COMMAND>

Commands

Command What it does
list List the organization’s keys, with who may use each and how
create Request a new key
grant Request access to a key for a team or person
revoke Request that a team or person lose access to a key
rotate Request a new version of a key
disable Request that a key be disabled
enable Request that a disabled key be enabled again
schedule-deletion Request that a key be deleted after a waiting period
cancel-deletion Request that a key’s scheduled deletion be canceled
encrypt Encrypt standard input and print the ciphertext in base64
decrypt Decrypt a base64 ciphertext from standard input
sign Sign standard input and print the signature in base64
verify Verify a base64 signature of standard input
public-key Print a signing key’s public key in PEM format
data-key Generate a data key for encrypting larger data yourself

Global options

Every af command also takes the global options.

Examples

af kms list
af kms create app-secrets --use-person ada@example.com
af kms create releases --spec ml-dsa-65 --use-team release

af kms list

List the organization’s keys, with who may use each and how

Usage

af kms list [OPTIONS]

Global options

Every af command also takes the global options.

af kms create

Request a new key

Name who may use the key with –use-team and –use-person (full use), or –seal-team and –seal-person (encrypt only, or verify only for a signing key). Requires an administrator; it takes effect at once unless the forge requires a second administrator.

Usage

af kms create [OPTIONS] <NAME>

Arguments

  • <NAME>

    Name of the key

Options

  • --spec <SPEC>

    Kind of key

    Possible values:

    • symmetric: AES-256-GCM key for encryption, decryption and data keys

    • ed25519: Ed25519 key for signing

    • ml-dsa-65: ML-DSA-65 key for post-quantum signing

    Default: symmetric

  • --use-team <USE_TEAM>

    Team that may fully use the key, as the identity provider names the group; repeatable

  • --use-person <USE_PERSON>

    Person who may fully use the key, by sign-in email; repeatable

  • --seal-team <SEAL_TEAM>

    Team that may only encrypt with the key (or verify, for a signing key); repeatable

  • --seal-person <SEAL_PERSON>

    Person who may only encrypt with the key (or verify, for a signing key); repeatable

  • --reason <REASON>

    Reason for the request, recorded with it

    Default: ""

Global options

Every af command also takes the global options.

af kms grant

Request access to a key for a team or person

An administrator’s request takes effect at once unless the forge requires a second administrator. Anyone else’s is approved by an administrator, or by someone else who holds the key with at least the access being granted.

Usage

af kms grant [OPTIONS] --may <MAY> <KEY>

Arguments

  • <KEY>

    Name of the key

Options

  • --team <TEAM>

    Team to grant access to, as the identity provider names the group

  • --person <PERSON>

    Person to grant access to, by sign-in email

  • --may <MAY>

    Access to grant

    Possible values:

    • use: Full use: encrypt and decrypt, or sign and verify

    • seal: Encrypt only, or verify only for a signing key

  • --reason <REASON>

    Reason for the request, recorded with it

    Default: ""

Global options

Every af command also takes the global options.

af kms revoke

Request that a team or person lose access to a key

An administrator’s request takes effect at once unless the forge requires a second administrator. Anyone else’s is approved by an administrator, or by someone else who holds the key with at least the access being revoked.

Usage

af kms revoke [OPTIONS] <KEY>

Arguments

  • <KEY>

    Name of the key

Options

  • --team <TEAM>

    Team to revoke access from, as the identity provider names the group

  • --person <PERSON>

    Person to revoke access from, by sign-in email

  • --reason <REASON>

    Reason for the request, recorded with it

    Default: ""

Global options

Every af command also takes the global options.

af kms rotate

Request a new version of a key

New encryptions use the new version, and every earlier version can still decrypt. Requires an administrator; it takes effect at once unless the forge requires a second administrator.

Usage

af kms rotate [OPTIONS] <KEY>

Arguments

  • <KEY>

    Name of the key

Options

  • --reason <REASON>

    Reason for the request, recorded with it

    Default: ""

Global options

Every af command also takes the global options.

af kms disable

Request that a key be disabled

A disabled key can’t be used for anything until it is enabled again. Requires an administrator; it takes effect at once unless the forge requires a second administrator.

Usage

af kms disable [OPTIONS] <KEY>

Arguments

  • <KEY>

    Name of the key

Options

  • --reason <REASON>

    Reason for the request, recorded with it

    Default: ""

Global options

Every af command also takes the global options.

af kms enable

Request that a disabled key be enabled again

Requires an administrator; it takes effect at once unless the forge requires a second administrator.

Usage

af kms enable [OPTIONS] <KEY>

Arguments

  • <KEY>

    Name of the key

Options

  • --reason <REASON>

    Reason for the request, recorded with it

    Default: ""

Global options

Every af command also takes the global options.

af kms schedule-deletion

Request that a key be deleted after a waiting period

The key is deleted once –days have passed. Until then it can’t be used, and once it is deleted, nothing encrypted with it can be decrypted again. af kms cancel-deletion stops the deletion. Requires an administrator; it takes effect at once unless the forge requires a second administrator.

Usage

af kms schedule-deletion [OPTIONS] <KEY>

Arguments

  • <KEY>

    Name of the key

Options

  • --days <DAYS>

    Days to wait before deleting the key, from 7 to 30

    Default: 30

  • --reason <REASON>

    Reason for the request, recorded with it

    Default: ""

Global options

Every af command also takes the global options.

af kms cancel-deletion

Request that a key’s scheduled deletion be canceled

The key stays disabled until it is enabled again. Requires an administrator; it takes effect at once unless the forge requires a second administrator.

Usage

af kms cancel-deletion [OPTIONS] <KEY>

Arguments

  • <KEY>

    Name of the key

Options

  • --reason <REASON>

    Reason for the request, recorded with it

    Default: ""

Global options

Every af command also takes the global options.

af kms encrypt

Encrypt standard input and print the ciphertext in base64

Encrypts up to 4,096 bytes with a symmetric key; for more data, use af kms data-key. Requires full or encrypt-only access to the key.

Usage

af kms encrypt [OPTIONS] <KEY>

Arguments

  • <KEY>

    Name of the key

Options

  • --context <CONTEXT>

    Encryption context pair, as name=value (repeatable); decrypting needs the same pairs

Global options

Every af command also takes the global options.

Examples

printf %s "$TOKEN" | af kms encrypt app-secrets --context env=prod > token.enc
af kms decrypt --context env=prod < token.enc

af kms decrypt

Decrypt a base64 ciphertext from standard input

Writes the plaintext to standard output. The ciphertext identifies its key. Requires full use of the key.

Usage

af kms decrypt [OPTIONS]

Options

  • --context <CONTEXT>

    Encryption context pair the data was encrypted with, as name=value; repeatable

Global options

Every af command also takes the global options.

af kms sign

Sign standard input and print the signature in base64

Signs up to 4,096 bytes with a signing key. Requires full use of the key.

Usage

af kms sign [OPTIONS] <KEY>

Arguments

  • <KEY>

    Name of the key

Global options

Every af command also takes the global options.

af kms verify

Verify a base64 signature of standard input

Prints valid if the signature verifies, and fails otherwise.

Usage

af kms verify [OPTIONS] --signature <SIGNATURE> <KEY>

Arguments

  • <KEY>

    Name of the key

Options

  • --signature <SIGNATURE>

    Signature to check, in base64

Global options

Every af command also takes the global options.

af kms public-key

Print a signing key’s public key in PEM format

Use it to verify the key’s signatures anywhere.

Usage

af kms public-key [OPTIONS] <KEY>

Arguments

  • <KEY>

    Name of the key

Global options

Every af command also takes the global options.

af kms data-key

Generate a data key for encrypting larger data yourself

Prints JSON with the data key encrypted under KEY and, unless –no-plaintext is given, the data key itself, both in base64. Keep the encrypted copy with your data; af kms decrypt recovers the data key from it, given the same context.

Usage

af kms data-key [OPTIONS] <KEY>

Arguments

  • <KEY>

    Name of the key

Options

  • --bytes <BYTES>

    Length of the data key in bytes, from 1 to 1,024

    Default: 32

  • --context <CONTEXT>

    Encryption context pair, as name=value; repeatable

  • --no-plaintext

    Print only the encrypted data key, without the plaintext

Global options

Every af command also takes the global options.

Type to search…

↑↓ navigate↵ selectEsc close