]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/gitformat-signature.txt
Merge branch 'jk/clone-allow-bare-and-o-together'
[thirdparty/git.git] / Documentation / gitformat-signature.txt
CommitLineData
20516890
ÆAB
1gitformat-signature(5)
2======================
76f9d8ba 3
20516890
ÆAB
4NAME
5----
6gitformat-signature - Git cryptographic signature formats
7
8SYNOPSIS
9--------
10[verse]
11<[tag|commit] object header(s)>
12<over-the-wire protocol>
13
14DESCRIPTION
15-----------
76f9d8ba
MG
16
17Git uses cryptographic signatures in various places, currently objects (tags,
18commits, mergetags) and transactions (pushes). In every case, the command which
19is about to create an object or transaction determines a payload from that,
20calls gpg to obtain a detached signature for the payload (`gpg -bsa`) and
21embeds the signature into the object or transaction.
22
23Signatures always begin with `-----BEGIN PGP SIGNATURE-----`
24and end with `-----END PGP SIGNATURE-----`, unless gpg is told to
25produce RFC1991 signatures which use `MESSAGE` instead of `SIGNATURE`.
26
f6c013df
JH
27Signatures sometimes appear as a part of the normal payload
28(e.g. a signed tag has the signature block appended after the payload
29that the signature applies to), and sometimes appear in the value of
30an object header (e.g. a merge commit that merged a signed tag would
31have the entire tag contents on its "mergetag" header). In the case
32of the latter, the usual multi-line formatting rule for object
33headers applies. I.e. the second and subsequent lines are prefixed
34with a SP to signal that the line is continued from the previous
35line.
36
37This is even true for an originally empty line. In the following
38examples, the end of line that ends with a whitespace letter is
39highlighted with a `$` sign; if you are trying to recreate these
40example by hand, do not cut and paste them---they are there
41primarily to highlight extra whitespace at the end of some lines.
42
76f9d8ba
MG
43The signed payload and the way the signature is embedded depends
44on the type of the object resp. transaction.
5f1abfeb
MG
45
46== Tag signatures
47
48- created by: `git tag -s`
49- payload: annotated tag object
50- embedding: append the signature to the unsigned tag object
51- example: tag `signedtag` with subject `signed tag`
52
53----
54object 04b871796dc0420f8e7561a895b52484b701d51a
55type commit
56tag signedtag
57tagger C O Mitter <committer@example.com> 1465981006 +0000
58
59signed tag
60
61signed tag message body
62-----BEGIN PGP SIGNATURE-----
63Version: GnuPG v1
64
65iQEcBAABAgAGBQJXYRhOAAoJEGEJLoW3InGJklkIAIcnhL7RwEb/+QeX9enkXhxn
66rxfdqrvWd1K80sl2TOt8Bg/NYwrUBw/RWJ+sg/hhHp4WtvE1HDGHlkEz3y11Lkuh
678tSxS3qKTxXUGozyPGuE90sJfExhZlW4knIQ1wt/yWqM+33E9pN4hzPqLwyrdods
68q8FWEqPPUbSJXoMbRPw04S5jrLtZSsUWbRYjmJCHzlhSfFWW4eFd37uquIaLUBS0
69rkC3Jrx7420jkIpgFcTI2s60uhSQLzgcCwdA2ukSYIRnjg/zDkj8+3h/GaROJ72x
70lZyI6HWixKJkWw8lE9aAOD9TmTW9sFJwcVAzmAuFX2kUreDUKMZduGcoRYGpD7E=
71=jpXa
72-----END PGP SIGNATURE-----
73----
74
75- verify with: `git verify-tag [-v]` or `git tag -v`
76
77----
78gpg: Signature made Wed Jun 15 10:56:46 2016 CEST using RSA key ID B7227189
79gpg: Good signature from "Eris Discordia <discord@example.net>"
80gpg: WARNING: This key is not certified with a trusted signature!
81gpg: There is no indication that the signature belongs to the owner.
82Primary key fingerprint: D4BE 2231 1AD3 131E 5EDA 29A4 6109 2E85 B722 7189
83object 04b871796dc0420f8e7561a895b52484b701d51a
84type commit
85tag signedtag
86tagger C O Mitter <committer@example.com> 1465981006 +0000
87
88signed tag
89
90signed tag message body
91----
eda2f11e
MG
92
93== Commit signatures
94
95- created by: `git commit -S`
96- payload: commit object
97- embedding: header entry `gpgsig`
98 (content is preceded by a space)
99- example: commit with subject `signed commit`
100
101----
102tree eebfed94e75e7760540d1485c740902590a00332
103parent 04b871796dc0420f8e7561a895b52484b701d51a
104author A U Thor <author@example.com> 1465981137 +0000
105committer C O Mitter <committer@example.com> 1465981137 +0000
106gpgsig -----BEGIN PGP SIGNATURE-----
107 Version: GnuPG v1
f6c013df 108 $
eda2f11e
MG
109 iQEcBAABAgAGBQJXYRjRAAoJEGEJLoW3InGJ3IwIAIY4SA6GxY3BjL60YyvsJPh/
110 HRCJwH+w7wt3Yc/9/bW2F+gF72kdHOOs2jfv+OZhq0q4OAN6fvVSczISY/82LpS7
111 DVdMQj2/YcHDT4xrDNBnXnviDO9G7am/9OE77kEbXrp7QPxvhjkicHNwy2rEflAA
112 zn075rtEERDHr8nRYiDh8eVrefSO7D+bdQ7gv+7GsYMsd2auJWi1dHOSfTr9HIF4
113 HJhWXT9d2f8W+diRYXGh4X0wYiGg6na/soXc+vdtDYBzIxanRqjg8jCAeo1eOTk1
114 EdTwhcTZlI0x5pvJ3H0+4hA2jtldVtmPM4OTB0cTrEWBad7XV6YgiyuII73Ve3I=
115 =jKHM
116 -----END PGP SIGNATURE-----
117
118signed commit
119
120signed commit message body
121----
122
123- verify with: `git verify-commit [-v]` (or `git show --show-signature`)
124
125----
126gpg: Signature made Wed Jun 15 10:58:57 2016 CEST using RSA key ID B7227189
127gpg: Good signature from "Eris Discordia <discord@example.net>"
128gpg: WARNING: This key is not certified with a trusted signature!
129gpg: There is no indication that the signature belongs to the owner.
130Primary key fingerprint: D4BE 2231 1AD3 131E 5EDA 29A4 6109 2E85 B722 7189
131tree eebfed94e75e7760540d1485c740902590a00332
132parent 04b871796dc0420f8e7561a895b52484b701d51a
133author A U Thor <author@example.com> 1465981137 +0000
134committer C O Mitter <committer@example.com> 1465981137 +0000
135
136signed commit
137
138signed commit message body
139----
cc6ee97c
MG
140
141== Mergetag signatures
142
143- created by: `git merge` on signed tag
144- payload/embedding: the whole signed tag object is embedded into
145 the (merge) commit object as header entry `mergetag`
146- example: merge of the signed tag `signedtag` as above
147
148----
149tree c7b1cff039a93f3600a1d18b82d26688668c7dea
150parent c33429be94b5f2d3ee9b0adad223f877f174b05d
151parent 04b871796dc0420f8e7561a895b52484b701d51a
152author A U Thor <author@example.com> 1465982009 +0000
153committer C O Mitter <committer@example.com> 1465982009 +0000
154mergetag object 04b871796dc0420f8e7561a895b52484b701d51a
155 type commit
156 tag signedtag
157 tagger C O Mitter <committer@example.com> 1465981006 +0000
f6c013df 158 $
cc6ee97c 159 signed tag
f6c013df 160 $
cc6ee97c
MG
161 signed tag message body
162 -----BEGIN PGP SIGNATURE-----
163 Version: GnuPG v1
f6c013df 164 $
cc6ee97c
MG
165 iQEcBAABAgAGBQJXYRhOAAoJEGEJLoW3InGJklkIAIcnhL7RwEb/+QeX9enkXhxn
166 rxfdqrvWd1K80sl2TOt8Bg/NYwrUBw/RWJ+sg/hhHp4WtvE1HDGHlkEz3y11Lkuh
167 8tSxS3qKTxXUGozyPGuE90sJfExhZlW4knIQ1wt/yWqM+33E9pN4hzPqLwyrdods
168 q8FWEqPPUbSJXoMbRPw04S5jrLtZSsUWbRYjmJCHzlhSfFWW4eFd37uquIaLUBS0
169 rkC3Jrx7420jkIpgFcTI2s60uhSQLzgcCwdA2ukSYIRnjg/zDkj8+3h/GaROJ72x
170 lZyI6HWixKJkWw8lE9aAOD9TmTW9sFJwcVAzmAuFX2kUreDUKMZduGcoRYGpD7E=
171 =jpXa
172 -----END PGP SIGNATURE-----
173
174Merge tag 'signedtag' into downstream
175
176signed tag
177
178signed tag message body
179
180# gpg: Signature made Wed Jun 15 08:56:46 2016 UTC using RSA key ID B7227189
181# gpg: Good signature from "Eris Discordia <discord@example.net>"
182# gpg: WARNING: This key is not certified with a trusted signature!
183# gpg: There is no indication that the signature belongs to the owner.
184# Primary key fingerprint: D4BE 2231 1AD3 131E 5EDA 29A4 6109 2E85 B722 7189
185----
186
187- verify with: verification is embedded in merge commit message by default,
188 alternatively with `git show --show-signature`:
189
190----
191commit 9863f0c76ff78712b6800e199a46aa56afbcbd49
192merged tag 'signedtag'
193gpg: Signature made Wed Jun 15 10:56:46 2016 CEST using RSA key ID B7227189
194gpg: Good signature from "Eris Discordia <discord@example.net>"
195gpg: WARNING: This key is not certified with a trusted signature!
196gpg: There is no indication that the signature belongs to the owner.
197Primary key fingerprint: D4BE 2231 1AD3 131E 5EDA 29A4 6109 2E85 B722 7189
198Merge: c33429b 04b8717
199Author: A U Thor <author@example.com>
200Date: Wed Jun 15 09:13:29 2016 +0000
201
202 Merge tag 'signedtag' into downstream
203
204 signed tag
205
206 signed tag message body
207
208 # gpg: Signature made Wed Jun 15 08:56:46 2016 UTC using RSA key ID B7227189
209 # gpg: Good signature from "Eris Discordia <discord@example.net>"
210 # gpg: WARNING: This key is not certified with a trusted signature!
211 # gpg: There is no indication that the signature belongs to the owner.
212 # Primary key fingerprint: D4BE 2231 1AD3 131E 5EDA 29A4 6109 2E85 B722 7189
213----
20516890
ÆAB
214
215GIT
216---
217Part of the linkgit:git[1] suite