Closed28

GitHubで「Verified」(コミット署名の検証の検証済み)のコミットしてみる

murnanamurnana

Generating a new GPG key
作ってみよー

murnanamurnana

Choose Components
デフォルトはこんなかんじ。全部いるのかしら?

murnanamurnana

Choose Install Locationデフォルトのインストール先
PC,主にゲーム用なのでフォルダは変えちゃおっかな

murnanamurnana

gpg --version でバージョンチェックできるみたい。

$ gpg --version
gpg (GnuPG) 2.2.29-unknown
libgcrypt 1.9.3-unknown
Copyright (C) 2021 Free Software Foundation, Inc.
License GNU GPL-3.0-or-later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /c/Users/<ユーザー名>/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2
murnanamurnana

If you are on version 2.1.17 or greater, paste the text below to generate a GPG key pair

なので、コマンドは

$ gpg --full-generate-key
murnanamurnana
$ gpg --full-generate-key
gpg (GnuPG) 2.2.29-unknown; Copyright (C) 2021 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Please select what kind of key you want:
   (1) RSA and RSA (default)
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
  (14) Existing key from card
Your selection? 1
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (3072) 4096
Requested keysize is 4096 bits
Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0)
Key does not expire at all
Is this correct? (y/N) y

手順 ③ ~ ⑦までいったん…

murnanamurnana
GnuPG needs to construct a user ID to identify your key.

Real name:

ここで、GitHubのユーザーIDを入れる

murnanamurnana
Email address:

GitHubアカウントで確認済みのメールアドレスか、no-replyメールアドレスを使う

murnanamurnana
Comment:

コメントだから、何の鍵?というメモに使えるやつかな?

murnanamurnana
You selected this USER-ID:
    "<ユーザー名> (<コメント>) <メールアドレス>"

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit?

最終確認。

murnanamurnana

あとはドキュメント通りに、gpg --list-secret-keys --keyid-format=long を打ってみる

$ gpg --list-secret-keys --keyid-format=long
/Users/hubot/.gnupg/secring.gpg
------------------------------------
sec   4096R/3AA5C34371567BD2 2016-03-10 [expires: 2017-03-10]
uid                          Hubot <hubot@example.com>
ssb   4096R/4BB6D45482678BE3 2016-03-10

ドキュメントからの引用。こんな感じらしい

そして、gpg --armor --export 3AA5C34371567BD2 という感じでたたけば
公開鍵が得られると。

このスクラップは2022/11/03にクローズされました