R.A. Epigonos et al.

[GnuPG] すべての公開鍵と秘密鍵を削除

ダミーユーザに作成したテスト鍵を全削除するのに一つづつやってるのはめんどくさい

まずは秘密鍵と公開鍵を表示。

$ gpg --list-public-keys && gpg --list-secret-keys

秘密鍵と公開鍵を両方共削除する。

$ gpg --no-greeting --delete-secret-and-public-keys $(gpg --with-colons --list-public-keys | awk -F: '$1 ~ /^pub$/{ print $5 }');

sec  4096R/1E708295 2015-12-30 hoge fuga <hoge@example.com>

Delete this key from the keyring? (y/N) y
This is a secret key! - really delete? (y/N) y

pub  4096R/1E708295 2015-12-30 hoge fuga <hoge@example.com>

Delete this key from the keyring? (y/N) y
$ gpg --delete-secret-keys $(gpg --with-colons --list-secret-keys | awk -F: '$1 ~ /^sec$/{ print $5 }');
$ gpg --delete-keys $(gpg --with-colons --list-public-keys | awk -F: '$1 ~ /^pub$/{ print $5 }');

リファレンス

  1. http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob_plain;f=doc/DETAILS

ソーシャルブックマーク

  1. はてなブックマーク
  2. Google Bookmarks
  3. del.icio.us

ChangeLog

  1. Posted: 2008-05-13T17:03:40+09:00
  2. Modified: 2008-05-13T17:03:40+09:00
  3. Generated: 2023-08-27T23:09:10+09:00