Skip to content

credctl init

Synopsis

Terminal window
credctl init [flags]

Description

credctl init generates a hardware-bound ECDSA P-256 key pair in the macOS Secure Enclave and writes the initial configuration to ~/.credctl/. The private key never leaves the Secure Enclave hardware. The public key is exported as a PEM file to ~/.credctl/device.pub.

Touch ID prompts you to authorise key creation.

This command creates:

  • ~/.credctl/config.json — device identity configuration (0600 permissions)
  • ~/.credctl/device.pub — public key in PEM format (0644 permissions)

Flags

FlagTypeDefaultDescription
--forcebooleanfalseDelete existing key and reinitialise. The old key is permanently destroyed.
--key-tagstringcom.crzy.credctl.device-keyOverride the Keychain application tag for the Secure Enclave key.

Examples

Basic initialisation

Terminal window
credctl init
Generating Secure Enclave key pair...
✓ Device identity created (Secure Enclave)
Fingerprint: SHA256:aBcDeFg...
Public key: ~/.credctl/device.pub
Next: Register this public key with your cloud provider or credctl broker.

Force reinitialisation

If you need to replace an existing device identity:

Terminal window
credctl init --force
Deleting existing key...
Generating Secure Enclave key pair...
✓ Device identity created (Secure Enclave)
Fingerprint: SHA256:xYzAbCd...
Public key: ~/.credctl/device.pub
Next: Register this public key with your cloud provider or credctl broker.

Exit codes

CodeMeaning
0Device identity created successfully
1Error (Secure Enclave not available, permission failure, or other error)

See also