# Signature support Binstall supports verifying signatures of downloaded files. At the moment, only one algorithm is supported, but this is expected to improve as time goes. This feature requires adding to the Cargo.toml metadata: no autodiscovery here! ## Minimal example Generate a [minisign](https://jedisct1.github.io/minisign/) keypair: ```console minisign -G -p signing.pub -s signing.key # or with rsign2: rsign generate -p signing.pub -s signing.key ``` In your Cargo.toml, put: ```toml [package.metadata.binstall.signing] algorithm = "minisign" pubkey = "RWRnmBcLmQbXVcEPWo2OOKMI36kki4GiI7gcBgIaPLwvxe14Wtxm9acX" ``` Replace the value of `pubkey` with the public key in your `signing.pub`. Save the `signing.key` as a secret in your CI, then use it when building packages: ```console tar cvf package-name.tar.zst your-files # or however minisign -S -s signing.key -x package-name.tar.zst.sig -m package-name.tar.zst # or with rsign2: rsign sign -s signing.key -x package-name.tar.zst.sig package-name.tar.zst ``` Upload both your package and the matching `.sig`. Now when binstall downloads your packages, it will also download the `.sig` file and use the `pubkey` in the Cargo.toml to verify the signature. If the signature has a trusted comment, it will print it at install time. `minisign` and `rsign2` by default prompt for a password when generating a keypair and signing, which can hinder automation. You can: - Pass `-W` to `minisign` or `rsign2` to generate a password-less private key. NOTE that you also need to pass this when signing. - When signing using `minisign`, it reads from stdin for password so you could use shell redirect to pass the password. - Use [`expect`] to pass password to `rsign2` (since it reads `/dev/tty` for password): For generating private key: ```bash expect <