Generate Evidence Key Pair CLI
Generate ECDSA key pairs for signing evidence with the JFrog CLI.
Description: Creates ECDSA P-256 key pairs for signing evidence. This command generates both private and public key files with secure permissions, and by default uploads the public key to the JFrog Platform for evidence verification.
Since: 2.82.0
Syntax
Basic key generation:
jf evd generate-key-pairCustom key generation:
jf evd generate-key-pair --key-file-path <directory-path> --key-file-name <base-name> --key-alias <alias-name> --upload-public-key=<true|false>Authentication
An admin token is required to upload the public key generated by this command (--upload-public-key=true) to the JFrog Platform. This is the default setting. No authentication is required to generate the key pair without uploading the public key (--upload-public-key=false). Basic authentication is not supported.
Command Parameters
| Option | Required/Optional | Type | Description |
|---|---|---|---|
--key-file-path | optional | string | The directory path for the key files. Creates the directory if it does not exist, but only one level deep. The default is the current directory. |
--key-file-name | optional | string | The base name for key files (without the extension):
evidence. |
--key-alias | optional | string | A case-sensitive name (alias) for the public key that makes it easy to identify in the JFrog Platform. If not provided, the CLI auto-generates a timestamp-based alias using the format: |
--upload-public-key | optional | boolean | Uploads the public key to the list of trusted keys in the JFrog Platform where it can be used to verify evidence. The default value is
|
--server-id | optional | string | The server ID configured using the jf config command. |
Tip
Use
--upload-public-key=falseduring development and testing to generate keys locally without requiring access to the JFrog Platform.
Example 1: Basic key generation
This command creates evidence.key (private) and evidence.pub (public) in the current directory and uploads the public key to the JFrog Platform.
jf evd generate-key-pair --server-id=my-serverExample 2: Custom key names, alias, and location
This command creates my-key.key and my-key.pub in the ./keys directory with a custom alias.
jf evd generate-key-pair --key-file-path ./keys --key-file-name my-key --key-alias production-signing-key --server-id my-serverExample 3: Generate key pair without uploading public key
This command generates a key pair without uploading the public key to the JFrog Platform.
jf evd generate-key-pair --upload-public-key=falseNote
For more information about creating evidence using the JFrog CLI, see Create Evidence CLI.
Frequently Asked Questions
Common questions about generating an evidence key pair.
FAQs
Q: How do I generate a key pair for signing evidence?
A: Run jf evd generate-key-pair to create an ECDSA P-256 private and public key pair. See Syntax for the basic and custom command forms.
Q: What do I need before uploading the public key to the JFrog Platform?
A: You need an admin token, since --upload-public-key=true (the default) uploads the key to the JFrog Platform. See Authentication.
Q: What happens if I don't set a key alias?
A: The CLI auto-generates a timestamp-based alias using the format evd-key-YYYYMMDD-HHMMSS.
Q: Can I generate a key pair without uploading the public key?
A: Yes. Set --upload-public-key=false to generate keys locally without requiring access to the JFrog Platform. See Example 3.
Q: Where are the generated key files stored by default?
A: In the current directory, using the default base name evidence (evidence.key and evidence.pub) unless you set --key-file-path or --key-file-name.
Related Topics
Updated 2 days ago
