The rotate-key command enables seamless API key rotation with overlapping validity periods. This allows you to update API keys in CI/CD systems without downtime - both the old and new keys remain valid during a configurable overlap period, after which the old key can be automatically revoked.
Note: This page provides command reference for the rotate-key command. For comprehensive workflows and best practices, see API Key Management. For lifecycle and policy information, see API Key Lifecycle.
SignotaurTool.exe rotate-key [options]
rotate-key with current API keyEnables zero-downtime key rotation across distributed build systems.
Exactly one of --api-key or --api-key-file may be specified. If neither is provided, the API key is read from the environment variable (default: SIGNOTAUR_API_KEY, or the name specified via --api-key-name).
-a, --api-key <APIKey>
Signotaur API key with ApiKeyRotation role and ownership of the key being rotated.
--af, --api-key-file <Path>
Path to file containing API key (alternative to --api-key). The file can be a plain text file containing just the API key, or a dotenv file with SIGNOTAUR_API_KEY=<key> format.
--akn, --api-key-name <VarName>
Specifies the variable name used when reading the API key from a dotenv file or environment variable (default: SIGNOTAUR_API_KEY).
-s, --sign-server <URL>
Signotaur server URL. Required unless provided via the SIGNOTAUR_SERVER environment variable or configuration file.
Server URL Resolution:
The server URL can be provided via:
--sign-server (command line argument)SIGNOTAUR_SERVER environment variablesignServer key)-o, --overlap-days <Days>
Number of days both old and new keys remain valid (default: 7, range: 0–30). A value of 0 schedules the old key for immediate revocation. During any overlap period, compromise of the old key remains possible until it is revoked.
--nar, --no-auto-revoke
Disable automatic revocation of the old key after the overlap period. The old key will remain valid indefinitely unless manually revoked. To manually revoke a key, navigate to the Signotaur Web UI → API Keys page, locate the old key, and click the "Revoke" button. Use this option when you need manual control over key lifecycle or have custom revocation workflows.
Only one of --write-key-file, --write-env-file, or --emit-secret may be specified. If no output option is specified, the new API key is written to stdout.
--wk, --write-key-file <Path>
Write new API key to a plain text file (mutually exclusive with --write-env-file and --emit-secret). The file will be created with secure permissions (Windows ACL owner-only read/write).
--we, --write-env-file <Path>
Write new API key to a dotenv file as <varName>=<key> (mutually exclusive with --write-key-file and --emit-secret).
--wn, --write-env-var-name <VarName>
Variable name when writing to dotenv file (default: SIGNOTAUR_API_KEY). Only used with --write-env-file. This option can only be used with --write-env-file.
-e, --emit-secret <Sink>
Emit new API key to stdout in a CI/CD-specific format (mutually exclusive with --write-key-file and --write-env-file). This allows integration with various CI/CD platforms that can capture command output.
⚠ The secret is written to stdout. Ensure your CI logs are masked or redacted appropriately.
Supported Formats:
continua:serverVar=NAME - Continua CI server variable formatcontinua:buildVar=NAME - Continua CI build variable formattemplate:CUSTOM_FORMAT - Custom template using variables (see below)Template Variables:
{{secret}} - Full API key{{keyId}} - New key ID (integer){{expiry}} - Expiration date (ISO 8601){{overlapEnd}} - Overlap end date (ISO 8601){{name}} - Key name from serverExample Templates:
template:SIGNOTAUR_API_KEY={{secret}}template:export SIGNOTAUR_API_KEY={{secret}}template:{"key":"{{secret}}","expires":"{{expiry}}"}--au, --allow-untrusted
Allow connecting to a Signotaur server bound to an untrusted or invalid certificate. Warning: This disables TLS certificate validation and should only be used in development or controlled environments.
Basic rotation (logs new key to console):
SignotaurTool.exe rotate-key --api-key "current-key" -s https://signotaur.example.com
Rotate and update stored key file:
SignotaurTool.exe rotate-key --api-key-file %USERPROFILE%\.signotaur\api_key.txt -s https://signotaur.example.com --write-key-file %USERPROFILE%\.signotaur\api_key.txt
Rotate with custom overlap period:
SignotaurTool.exe rotate-key --api-key-file %USERPROFILE%\.signotaur\api_key.txt -s https://signotaur.example.com --overlap-days 14 --write-key-file %USERPROFILE%\.signotaur\api_key.txt
Rotate without auto-revocation (manual control):
SignotaurTool.exe rotate-key --api-key-file %USERPROFILE%\.signotaur\api_key.txt -s https://signotaur.example.com --no-auto-revoke --write-key-file %USERPROFILE%\.signotaur\api_key.txt
Rotate and emit for Continua CI:
SignotaurTool.exe rotate-key --api-key-file %USERPROFILE%\.signotaur\api_key.txt -s https://signotaur.example.com --emit-secret "continua:serverVar=SignotaurApiKey"
Rotate and write to dotenv file:
SignotaurTool.exe rotate-key --api-key-file %USERPROFILE%\.signotaur\api_key.txt -s https://signotaur.example.com --write-env-file .env
Custom template:
SignotaurTool.exe rotate-key --api-key-file %USERPROFILE%\.signotaur\api_key.txt -s https://signotaur.example.com --emit-secret "template:SIGNOTAUR_API_KEY={{secret}}"
Each rotated key maintains an audit trail:
rotated_from_key_id - Links new key to original keyrotation_timestamp_utc - When the rotation occurredauto_revoke_old_key_utc - When automatic revocation will occur (if enabled)This provides full lineage tracking for compliance and auditing purposes.
Set as server variable (persistent across builds):
SignotaurTool.exe rotate-key --api-key-file %SIGNOTAUR_KEY_FILE% -s %SERVER_URL% --emit-secret "continua:serverVar=SignotaurApiKey"
Set as build variable (current build only):
SignotaurTool.exe rotate-key --api-key-file %SIGNOTAUR_KEY_FILE% -s %SERVER_URL% --emit-secret "continua:buildVar=SignotaurApiKey"
See Continua CI Custom Log Messages for more details on variable types.
SignotaurTool.exe rotate-key --api-key-file %USERPROFILE%\.signotaur\api_key.txt -s https://signotaur.example.com --write-key-file %USERPROFILE%\.signotaur\api_key.txt
REM Jenkins will use the updated file on next build
--api-key-file or environment variable instead of --api-key--no-auto-revoke unless you have manual revocation processesFor comprehensive guidance on integrating API key rotation into your CI/CD pipelines, see CI/CD Integration Best Practices.
Key principles:
sign with --fail-if-expiring-withinrotate-key with appropriate overlapThe --overlap-days option accepts integer values representing days (examples):
0 (schedules the old key for immediate revocation)17 (default)1430 (maximum)Ensure the API key maps to a valid user and that the user has the ApiKeyRotation role assigned on the server.
Check if --no-auto-revoke was used. Without this flag, the server background service automatically revokes the old key after the overlap period expires. The service runs hourly.