Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Commit

Permalink
Merge branch 'master' of git://github.com/klacointe/openpgp.git
Browse files Browse the repository at this point in the history
  • Loading branch information
artob committed Dec 20, 2009
2 parents 75cee8b + 5497d49 commit 81826a9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/openpgp/engine/gnupg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,19 @@ def import()
# TODO
end

def delete_secret_and_public_key(key_id)
opts = {:batch => true}
OpenPGP::Message.parse(exec([:delete_secret_and_public_key, key_fingerprint(key_id)], opts ).read)
end

def key_fingerprint(key_id, opts = {})
message = exec([:fingerprint, *[key_id].flatten], opts ).read
if message =~ /Key fingerprint = (.*)\n/
return $1.delete(" ")
end
nil
end

##
# Returns an array of key IDs/titles of the keys in the public keyring.
def list_keys()
Expand Down

0 comments on commit 81826a9

Please sign in to comment.