···4455## Generating keys
6677-Signing keys can be generated with [`signify`](https://man.openbsd.org/signify.1),
88-from the OpenBSD project.
77+Signing keys can be generated with [`signify`], from the OpenBSD project.
98109```
1110$ signify -G -p newkey.pub -s newkey.sec
···1413If you do not wish to encrypt your keys, pass the `-n` flag to the
1514command line of `signify`.
16151616+Alternatively, [`minisign`] keys may also be used. This project provides
1717+a more portable alternative to [`signify`].
1818+1919+```
2020+$ minisign -G -p newkey.pub -s newkey.sec
2121+```
2222+2323+`git-signify` always assumes that [`minisign`] keys are encrypted,
2424+albeit the CLI tool allows generating non-encrypted keys.
2525+2626+[`signify`]: https://man.openbsd.org/signify.1
2727+[`minisign`]: https://github.com/jedisct1/minisign
2828+1729## Basic usage
18301931This program keeps track of signatures made by a keypair with a given
···3143```
3244$ git pull --tags
3345$ git signify pull
3434-$ git signify verify -k <(curl -sfL https://gandas.us.to/keys/git.pub) v0.3.0
4646+$ git signify verify -k <(curl -sfL https://gandas.us.to/keys/git.pub) v0.7.0
4747+$ git signify verify -k <(curl -sfL https://gandas.us.to/keys/git_minisign.pub) v0.7.0
3548```
36493750To sign git revisions, run something akin to:
38513952```
4040-$ git signify sign -k <secret-key> v0.3.0
5353+$ git signify sign -k <secret-key> v0.7.0
4154```
42554356## In-depth
···4861following blobs:
49625063```
5151-100644 blob aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa object
6464+100644 blob aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa algorithm
5265100644 blob bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb signature
6666+100644 blob cccccccccccccccccccccccccccccccccccccccc version
5367```
54685555-Where `object` stores the raw (20 byte) object id of some git object
5656-to be signed, and `signature` stores the signature over `object`. The
5757-tree's hash is returned by `git signify raw sign`.
6969+Another git object `object` may be present in the tree, if a signature
7070+over a blob or another tree is being made. This `object` is a pointer
7171+to the respective git object being signed over. On the other hand,
7272+`signature` contains the base64 encoded `signify` or `minisign` signature
7373+over the raw (20 byte) id of `object`. The remaining blobs, `version` and
7474+`algorithm`, represent the current version of the `git-signify` tree format
7575+and the algorithm (`minisign` or `signify`) being used, respectively.
58765959-### Storing signatures in tags
6060-6161-To store signatures in tags, one must use the "raw" mode of `git-signify`.
6262-The raw flags supported by this program and their respective documentation
6363-can be checked by running the following commands:
6464-6565-```
6666-$ git signify raw -h
6767-$ git signify raw sign -h
6868-$ git signify raw verify -h
6969-```
7070-7171-The suggested approach to store signatures in tags is the following:
7272-7373-```
7474-$ SIGNATURE_TREE=$(git signify raw sign -k $SECRET_KEY $OBJECT_TO_SIGN)
7575-$ SIGNATURE_COMMIT=$(git commit-tree $SIGNATURE_TREE -m Signature)
7676-$ git tag signature-$OBJECT_TO_SIGN $SIGNATURE_COMMIT
7777-$ git push --tags
7878-```
7979-8080-Verification can then be done with:
7777+The tree is then committed along with a potential parent, which is the commit
7878+hash being signed over, if any. The resulting commit's hash is returned by
7979+`git signify raw sign`.
81808282-```
8383-$ git signify raw verify -p -k $PUBLIC_KEY $SIGNATURE_COMMIT^{tree}
8484-```
8181+Signatures end up in `refs/signify/signatures/${key_fingerprint}/${sig_hash}`,
8282+where `$key_fingerprint` can be computed by `git signify fingerprint`, and
8383+`$sig_hash` is a hash returned by `git signify raw sign`.