Bravely generate key pairs, sign files, and check signatures.
BraveSigner is a Go-powered CLI tool that lets you generate cryptographic key pairs, sign files, and verify digital signatures using Ed25519. It prioritizes strong encryption practices, ease of use, and flexibility.
Full command reference in /docs/brave_signer.md
brave_signer COMMAND FLAGS
Available commands:
-
keys generate [--pub-key-path pub_key.pem] [--priv-key-path priv_key.pem]
Generate an Ed25519 key pair.
The private key is encrypted with XChaCha20Poly1305 using a passphrase you enter, derived securely via Argon2. -
signatures signfile --file-path PATH_TO_FILE --signer-id SIGNER_NAME_OR_ID [--priv-key-path priv_key.pem]
Sign a file using your private key.
A.sigfile will be created next to the original file, containing the signature and signer ID (up to 65,535 characters). -
signatures verifyfile --file-path PATH_TO_FILE [--pub-key-path pub_key.pem]
Verify a file against its.sigusing an Ed25519 public key.
The.sigfile should be named<filename>.sigand stored alongside the original.
All command line arguments can also be specified inside a config file. By default the script searches for a config.yaml file inside the current directory but it can be adjusted with the following CLI arguments:
--config-file-name(defaults toconfig)--config-file-type(defaults toyaml)--config-path(defaults to.)
For example, to adjust the signer:
signer-id: John DoeIn this case, you don't need to provide --signer-id when calling signatures signfile.
Note that CLI flags have priority over the parameters provided in the config file.
All parameters can also be provided via environment variables. This is useful in CI/CD setups, containerized environments, or when you want to avoid hardcoding values in config files.
Environment variables follow this format:
BRAVE_SIGNER_<PARAMETER_NAME>
Hyphens (-) in parameter names are replaced with underscores (_). For example --file-path can be set with BRAVE_SIGNER_FILE_PATH.
When resolving configuration values, the priority is as follows:
- Command-line arguments
- Environment variables
- Config file (config.yaml, etc.)
- Default values
(c) Ilya Krukowski