-
-
Notifications
You must be signed in to change notification settings - Fork 1
Description
xid service add currently only accepts public key references via --key. There's no way to add a private key to a service and have it encrypted for secure storage.
xid key add supports this with --private encrypt, but services can only reference keys—they can't include key material directly.
The Gap
# xid key add supports encrypted private keys:
envelope xid key add --private encrypt "$PRVKEYS" "$XID_DOC"
# xid service add does not:
envelope xid service add --key "$PUBKEYS" ... # public reference onlyProposed
Add --private option to xid service add, matching the existing xid key add interface:
XID_DOC=$(envelope xid service add \
--name "GitHub" \
--prvkeys "$PRVKEYS" \
--private encrypt \
--password "$PASSWORD" \
"https://github.com/username" \
"$XID_DOC")The key would be created, encrypted, and automatically referenced by the service.
Use Case: GitHub with SSH Signing Keys
Linking a GitHub account requires an SSH signing key (not the XID's inception key). Key separation matters here—the SSH key is service-specific and should be:
- Generated using
--signing ssh-ed25519(or other SSH types) - Importable from existing OpenSSH key files via
envelope import - Encrypted at rest in the XID document
- Scoped to the GitHub service only
# Import existing SSH key from ~/.ssh
SSH_PRVKEYS=$(envelope import <~/.ssh/id_ed25519)
# Add GitHub service with encrypted SSH private key
XID_DOC=$(envelope xid service add \
--name "GitHub" \
--prvkeys "$SSH_PRVKEYS" \
--private encrypt \
--allow sign \
"https://github.com/username" \
"$XID_DOC")The SSH key signs commits and proves account control. It can be exported to OpenSSH format (envelope export) for use with git. If compromised, the service key can be rotated without affecting the XID's core identity keys.
Suggested Options
| Option | Purpose |
|---|---|
--prvkeys <UR> |
Private keys to embed in the service |
--private encrypt |
Encrypt the private key material |
--password / --askpass |
Password for encryption |
--key-nickname <NAME> |
Optional nickname for the key |
Current Workaround
Two-step process:
XID_DOC=$(envelope xid key add --private encrypt "$PRVKEYS" "$XID_DOC")
XID_DOC=$(envelope xid service add --key "$PUBKEYS" ... "$XID_DOC")This works but separates what users think of as one operation: "add a service with its encrypted signing key."
cc @shannona