Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# History

## Unreleased - TBD

### Added

- `key create --type aes256` generates a symmetric AES-256 key-encryption key
(KEK): 32 random bytes carried as a `Multikey` `secretKeyMultibase` (the
AES-256 multicodec header `0xa2 0x01` followed by the raw key bytes),
identified by a `urn:kek:sha256:` id derived from the SHA-256 digest of the
raw key bytes. This is the form Wallet Attached Storage servers accept for
their at-rest key-encryption-key configuration. Generation is always fresh and
random, so `--with-seed` and `SECRET_KEY_SEED` are not supported for this
type. `key show` prints only the safe `id` and `type` for a saved KEK, never
the secret material.

## 0.12.0 - 2026-07-09

### Changed
Expand Down
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ SECRET_KEY_SEED=z1AXVyT6G1Qk3E9cMPkDYY6wVRpZjVGWAZ3TfrAgFZkX6bv ./di key create
```

Specify an explicit key type with `--type` (defaults to `ed25519`; supported:
`ed25519`, `ecdsa`, `x25519`, `hmac`):
`ed25519`, `ecdsa`, `x25519`, `hmac`, `aes256`):

```
SECRET_KEY_SEED=z1Aaj5A4UCsd... ./di key create --type ed25519
Expand Down Expand Up @@ -244,6 +244,32 @@ half), identified by a random `urn:uuid:` id:
HMAC key generation is non-deterministic, so `--with-seed` and `SECRET_KEY_SEED`
are not supported with `--type hmac`.

Generate a symmetric AES-256 key-encryption key (KEK) -- 32 random bytes carried
as a Multikey `secretKeyMultibase` -- with `--type aes256`:

```
./di key create --type aes256
```

It is serialized as a `Multikey` with the secret carried as a base58btc
`secretKeyMultibase` (the AES-256 multicodec header `0xa2 0x01` followed by the
32 raw key bytes, no public half), identified by a `urn:kek:sha256:` id derived
from the SHA-256 digest of the raw key bytes:

```json
{
"id": "urn:kek:sha256:...",
"type": "Multikey",
"secretKeyMultibase": "z..."
}
```

This is the form Wallet Attached Storage servers accept for their at-rest
key-encryption-key configuration (`KMS_RECORD_KEK` / `KMS_RECORD_KEKS`), where
each KEK is identified by the same derived `urn:kek:sha256:` id. Generation is
always fresh and random, so `--with-seed` and `SECRET_KEY_SEED` are not
supported with `--type aes256`.

Save the key to local wallet storage (`~/.config/did-cli-wallet/keys/` by
default, or
`$WALLET_DIR/keys/` if set) with `--save`. A `.meta.json` metadata sidecar is
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dependencies": {
"@digitalcredentials/bnid": "^5.0.0",
"@digitalcredentials/issuer-registry-client": "^4.0.0",
"@interop/data-integrity-core": "^8.1.0",
"@interop/data-integrity-core": "^8.2.0",
"@interop/data-integrity-proof": "^3.4.1",
"@interop/did-io": "^4.0.6",
"@interop/did-method-key": "^7.3.3",
Expand All @@ -36,14 +36,14 @@
"@interop/ecdsa-signature": "2.0.4",
"@interop/ed25519-signature": "^7.1.3",
"@interop/ed25519-verification-key": "^8.0.2",
"@interop/edv-client": "^17.5.0",
"@interop/edv-client": "^17.6.1",
"@interop/ezcap": "^7.3.2",
"@interop/minimal-cipher": "^7.5.0",
"@interop/minimal-cipher": "^7.6.1",
"@interop/security-document-loader": "^9.4.1",
"@interop/vc": "^11.0.5",
"@interop/verifier-core": "^3.3.1",
"@interop/was-client": "^0.13.3",
"@interop/x25519-key-agreement-key": "^5.1.1",
"@interop/was-client": "^0.14.5",
"@interop/x25519-key-agreement-key": "^5.2.0",
"@interop/zcap": "^11.0.4",
"@scure/base": "^2.2.0",
"commander": "^15.0.0"
Expand Down
Loading