Git
日本語 ▾ トピック ▾ 最新バージョン ▾ gitformat-signature は 2.40.0 で最後に更新されました

名前

gitformat-signature - Git 暗号署名形式

概要

<[tag|commit] object header(s)>
<over-the-wire protocol>

説明

Git は、現在、オブジェクト(タグ、コミット、マージタグ)およびトランザクション(プッシュ)など、さまざまな場所で暗号署名を使用します。いずれの場合も、オブジェクトまたはトランザクションを作成しようとしているコマンドは、それからペイロードを決定し、ペイロードのデタッチされた署名を取得するために外部プログラム(PGP 署名の場合は gpg -bsa)を呼び出し、署名をオブジェクトまたはトランザクションに埋め込みます。

署名は、「ASCII Armor」ヘッダー行で始まり、署名タイプ(gpg.format で選択、git-config[1] 参照)に応じて異なるテール行で終わります。これらは、gpg.format の値に対して以下のとおりです。

gpg(PGP)

-----BEGIN PGP SIGNATURE----- および -----END PGP SIGNATURE-----。または、gpg が RFC1991 署名を生成するように指示されている場合は、-----BEGIN PGP MESSAGE----- および -----END PGP MESSAGE-----

ssh(SSH)

-----BEGIN SSH SIGNATURE----- および -----END SSH SIGNATURE-----

x509(X.509)

-----BEGIN SIGNED MESSAGE----- および -----END SIGNED MESSAGE-----

署名は、通常のペイロードの一部として(例:署名付きタグには、署名が適用されるペイロードの後に署名ブロックが追加されます)表示されたり、オブジェクトヘッダーの値として(例:署名付きタグをマージしたマージコミットには、その「mergetag」ヘッダーにタグの内容全体が含まれます)表示されたりする場合があります。後者の場合、オブジェクトヘッダーの通常の複数行書式ルールが適用されます。つまり、2行目以降の行には、その行が前の行から続いていることを示すためにSPがプレフィックスとして付けられます。

これは、もともと空の行の場合でも当てはまります。以下の例では、空白文字で終わる行の末尾は $ 記号で強調表示されています。これらの例を手動で再現しようとしている場合は、コピーアンドペーストしないでください。それらは主に一部の行末の余分な空白を強調表示するためにあります。

署名付きペイロードと署名が埋め込まれる方法は、オブジェクトまたはトランザクションのタイプによって異なります。

タグ署名

  • 作成者: git tag -s

  • ペイロード: 注釈付きタグオブジェクト

  • 埋め込み: 署名なしのタグオブジェクトに署名を追加します

  • 例: 件名が signed tag のタグ signedtag

object 04b871796dc0420f8e7561a895b52484b701d51a
type commit
tag signedtag
tagger C O Mitter <committer@example.com> 1465981006 +0000

signed tag

signed tag message body
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAABAgAGBQJXYRhOAAoJEGEJLoW3InGJklkIAIcnhL7RwEb/+QeX9enkXhxn
rxfdqrvWd1K80sl2TOt8Bg/NYwrUBw/RWJ+sg/hhHp4WtvE1HDGHlkEz3y11Lkuh
8tSxS3qKTxXUGozyPGuE90sJfExhZlW4knIQ1wt/yWqM+33E9pN4hzPqLwyrdods
q8FWEqPPUbSJXoMbRPw04S5jrLtZSsUWbRYjmJCHzlhSfFWW4eFd37uquIaLUBS0
rkC3Jrx7420jkIpgFcTI2s60uhSQLzgcCwdA2ukSYIRnjg/zDkj8+3h/GaROJ72x
lZyI6HWixKJkWw8lE9aAOD9TmTW9sFJwcVAzmAuFX2kUreDUKMZduGcoRYGpD7E=
=jpXa
-----END PGP SIGNATURE-----
  • 検証方法: git verify-tag [-v] または git tag -v

gpg: Signature made Wed Jun 15 10:56:46 2016 CEST using RSA key ID B7227189
gpg: Good signature from "Eris Discordia <discord@example.net>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: D4BE 2231 1AD3 131E 5EDA  29A4 6109 2E85 B722 7189
object 04b871796dc0420f8e7561a895b52484b701d51a
type commit
tag signedtag
tagger C O Mitter <committer@example.com> 1465981006 +0000

signed tag

signed tag message body

コミット署名

  • 作成者: git commit -S

  • ペイロード: コミットオブジェクト

  • 埋め込み: ヘッダーエントリ gpgsig(内容はスペースが前に付きます)

  • 例: 件名が signed commit のコミット

tree eebfed94e75e7760540d1485c740902590a00332
parent 04b871796dc0420f8e7561a895b52484b701d51a
author A U Thor <author@example.com> 1465981137 +0000
committer C O Mitter <committer@example.com> 1465981137 +0000
gpgsig -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 $
 iQEcBAABAgAGBQJXYRjRAAoJEGEJLoW3InGJ3IwIAIY4SA6GxY3BjL60YyvsJPh/
 HRCJwH+w7wt3Yc/9/bW2F+gF72kdHOOs2jfv+OZhq0q4OAN6fvVSczISY/82LpS7
 DVdMQj2/YcHDT4xrDNBnXnviDO9G7am/9OE77kEbXrp7QPxvhjkicHNwy2rEflAA
 zn075rtEERDHr8nRYiDh8eVrefSO7D+bdQ7gv+7GsYMsd2auJWi1dHOSfTr9HIF4
 HJhWXT9d2f8W+diRYXGh4X0wYiGg6na/soXc+vdtDYBzIxanRqjg8jCAeo1eOTk1
 EdTwhcTZlI0x5pvJ3H0+4hA2jtldVtmPM4OTB0cTrEWBad7XV6YgiyuII73Ve3I=
 =jKHM
 -----END PGP SIGNATURE-----

signed commit

signed commit message body
  • 検証方法: git verify-commit [-v](または git show --show-signature

gpg: Signature made Wed Jun 15 10:58:57 2016 CEST using RSA key ID B7227189
gpg: Good signature from "Eris Discordia <discord@example.net>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: D4BE 2231 1AD3 131E 5EDA  29A4 6109 2E85 B722 7189
tree eebfed94e75e7760540d1485c740902590a00332
parent 04b871796dc0420f8e7561a895b52484b701d51a
author A U Thor <author@example.com> 1465981137 +0000
committer C O Mitter <committer@example.com> 1465981137 +0000

signed commit

signed commit message body

マージタグ署名

  • 作成者: 署名付きタグに対する git merge

  • ペイロード/埋め込み: 署名付きタグオブジェクト全体が、ヘッダーエントリ mergetag として(マージ)コミットオブジェクトに埋め込まれます

  • 例: 上記の署名付きタグ signedtag のマージ

tree c7b1cff039a93f3600a1d18b82d26688668c7dea
parent c33429be94b5f2d3ee9b0adad223f877f174b05d
parent 04b871796dc0420f8e7561a895b52484b701d51a
author A U Thor <author@example.com> 1465982009 +0000
committer C O Mitter <committer@example.com> 1465982009 +0000
mergetag object 04b871796dc0420f8e7561a895b52484b701d51a
 type commit
 tag signedtag
 tagger C O Mitter <committer@example.com> 1465981006 +0000
 $
 signed tag
 $
 signed tag message body
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 $
 iQEcBAABAgAGBQJXYRhOAAoJEGEJLoW3InGJklkIAIcnhL7RwEb/+QeX9enkXhxn
 rxfdqrvWd1K80sl2TOt8Bg/NYwrUBw/RWJ+sg/hhHp4WtvE1HDGHlkEz3y11Lkuh
 8tSxS3qKTxXUGozyPGuE90sJfExhZlW4knIQ1wt/yWqM+33E9pN4hzPqLwyrdods
 q8FWEqPPUbSJXoMbRPw04S5jrLtZSsUWbRYjmJCHzlhSfFWW4eFd37uquIaLUBS0
 rkC3Jrx7420jkIpgFcTI2s60uhSQLzgcCwdA2ukSYIRnjg/zDkj8+3h/GaROJ72x
 lZyI6HWixKJkWw8lE9aAOD9TmTW9sFJwcVAzmAuFX2kUreDUKMZduGcoRYGpD7E=
 =jpXa
 -----END PGP SIGNATURE-----

Merge tag 'signedtag' into downstream

signed tag

signed tag message body

# gpg: Signature made Wed Jun 15 08:56:46 2016 UTC using RSA key ID B7227189
# gpg: Good signature from "Eris Discordia <discord@example.net>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: D4BE 2231 1AD3 131E 5EDA  29A4 6109 2E85 B722 7189
  • 検証方法: 検証はデフォルトでマージコミットメッセージに埋め込まれます。または、git show --show-signature を使用します

commit 9863f0c76ff78712b6800e199a46aa56afbcbd49
merged tag 'signedtag'
gpg: Signature made Wed Jun 15 10:56:46 2016 CEST using RSA key ID B7227189
gpg: Good signature from "Eris Discordia <discord@example.net>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: D4BE 2231 1AD3 131E 5EDA  29A4 6109 2E85 B722 7189
Merge: c33429b 04b8717
Author: A U Thor <author@example.com>
Date:   Wed Jun 15 09:13:29 2016 +0000

    Merge tag 'signedtag' into downstream

    signed tag

    signed tag message body

    # gpg: Signature made Wed Jun 15 08:56:46 2016 UTC using RSA key ID B7227189
    # gpg: Good signature from "Eris Discordia <discord@example.net>"
    # gpg: WARNING: This key is not certified with a trusted signature!
    # gpg:          There is no indication that the signature belongs to the owner.
    # Primary key fingerprint: D4BE 2231 1AD3 131E 5EDA  29A4 6109 2E85 B722 7189

GIT

git[1] スイートの一部

scroll-to-top