2003年12月01日

PGP公開鍵への署名方法

公開鍵をもらい受け,それを用いて暗号化や署名検証を行うには,
その公開鍵を使う前に,自らの鍵で署名をしておく必要があります.
これは,不当に挿入された公開鍵を誤って利用することを防ぐためです.

Windows で gnupg-w32cli-1.2.1-1 を利用しました.
GnuPGを使っている場合は,次のように署名することができます.

署名には2種類ある
A.ローカルのtrustdbに署名するもの
  個人的見解として秘密にtrustdbに保存するものである
B.鍵に直接署名するもの
  keyringに書き込まれる

A1.鍵に署名するには次のコマンドを実行する
  --local-user は署名に用いる鍵を,--edit-keyは署名する対象となる鍵を指定する
  --local-user は省略可能
「gpg --local-user username@domainname
--edit-key dear@friend.com」

A2.Aの方式で署名する(Bの方式は下記)
Command> 「 lsign 」

A3.いくつかの質問に答える
This key is due to expire on 2005-02-23.
Do you want your signature to expire at the same time? (Y/n) 「Y」

How carefully have you verified the key you are about to sign actually belongs
to the person named above? If you don't know what to answer, enter "0".

(0) I will not answer. (default)
(1) I have not checked at all.
(2) I have done casual checking.
(3) I have done very careful checking.

Your selection? 「0」

Are you really sure that you want to sign this key
with your key: "Toshikazu Ichikawa "

The signature will be marked as non-exportable.

Really sign? 「yes」

You need a passphrase to unlock the secret key for
user: "Toshikazu Ichikawa "
1024-bit DSA key, ID AD02033E, created 2002-11-07
「パスフレーズ」

A4.最後に上記の操作を有効にするため,保存する
Command> 「 save 」


B1.次にBの方式で署名をします.
  鍵に署名するには次のコマンドを実行する
  --local-user は署名に用いる鍵を,--edit-keyは署名する対象となる鍵を指定する
  --local-user は省略可能
「gpg --local-user username@domainname
--edit-key dear@friend.com」

B2.Bの方式で署名する
Command> 「 sign 」

B3.いくつかの質問に答える
Your current signature on "Dear Friend "
is a local signature.
Do you want to promote it to a full exportable signature? (y/N) 「y」

pub 1024D/7CF59B84 created: 2003-02-24 expires: 2005-02-23 trust: -/f
Primary key fingerprint: F9B6 E256 D5CF 3FDD 9DBA 120F 2336 6CC7 7CF5 9B84

Dear Friend

This key is due to expire on 2005-02-23.
Do you want your signature to expire at the same time? (Y/n)「y」
How carefully have you verified the key you are about to sign actually belongs
to the person named above? If you don't know what to answer, enter "0".

(0) I will not answer. (default)
(1) I have not checked at all.
(2) I have done casual checking.
(3) I have done very careful checking.

Your selection? 「3」
Are you really sure that you want to sign this key
with your key: "Toshikazu Ichikawa "

I have checked this key very carefully.

Really sign? 「yes」

You need a passphrase to unlock the secret key for
user: "Toshikazu Ichikawa "
1024-bit DSA key, ID AD02033E, created 2002-11-07
「パスフレーズ」

B4.最後に上記の操作を有効にするため,保存する
Command> 「 save 」

B5.方式B(直接鍵に署名する)で署名をした場合は,
  署名つきの状態で鍵を取り出すことができます
  署名をした公開鍵を取り出すには,
「gpg --export --armor dear@friend.com」を実行する