From 1693197f731d7bd11c75d17d0400047836694d2e Mon Sep 17 00:00:00 2001 From: BJ Hargrave Date: Mon, 13 Sep 2021 17:58:55 -0400 Subject: [PATCH] cleanup: Use --delete-secret-and-public-key to delete GPG_PRIVATE_KEY This deletes the secret key(s) and public keys(s) for the fingerprint of the installed GPG_PRIVATE_KEY. If the installed GPG_PRIVATE_KEY only contains a signing subkey without the primary private key, the --delete-secret-and-public-key will successfully delete the keys. Signed-off-by: BJ Hargrave --- src/gpg.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gpg.ts b/src/gpg.ts index 10c203348..82fd22ffe 100644 --- a/src/gpg.ts +++ b/src/gpg.ts @@ -39,8 +39,7 @@ export async function importKey(privateKey: string) { } export async function deleteKey(keyFingerprint: string) { - await exec.exec('gpg', ['--batch', '--yes', '--delete-secret-keys', keyFingerprint], { + await exec.exec('gpg', ['--batch', '--yes', '--delete-secret-and-public-key', keyFingerprint], { silent: true }); - await exec.exec('gpg', ['--batch', '--yes', '--delete-keys', keyFingerprint], { silent: true }); }