Skip to content

credctl init

Terminal window
credctl init [flags]

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. By default, Touch ID is also required for all future signing operations (e.g., credctl auth). Use the --biometric flag to control this behaviour.

This command creates:

  • ~/.credctl/config.json — device identity configuration (0600 permissions)
  • ~/.credctl/device.pub — public key in PEM format (0644 permissions)
FlagTypeDefaultDescription
--forcebooleanfalseDelete existing key and reinitialise. The old key is permanently destroyed.
--biometricstringanyBiometric policy for signing operations. any — Touch ID with passcode fallback (kSecAccessControlUserPresence). fingerprint — Touch ID only, no passcode fallback; key is invalidated if fingerprints change (kSecAccessControlBiometryCurrentSet). none — no user verification; signing happens silently when the device is unlocked.
--key-tagstringcom.crzy.credctl.device-keyOverride the Keychain application tag for the Secure Enclave key.
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.

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.

Disable Touch ID (headless or clamshell environments)

Section titled “Disable Touch ID (headless or clamshell environments)”

For Mac minis, CI runners, or laptops in clamshell mode where Touch ID is not available:

Terminal window
credctl init --biometric=none
CodeMeaning
0Device identity created successfully
1Error (Secure Enclave not available, permission failure, or other error)