summaryrefslogtreecommitdiff
path: root/src/share
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2013-01-18 15:22:54 -0500
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2013-01-18 15:22:54 -0500
commitcd03ac0a10a43efa3ebf4a8d48a759e26f2e0f0a (patch)
tree526b1adf116ed2e8ea88b969711521471d0ab7f5 /src/share
parent8fe76e1bb054e843aa57715d01ab629953eaa419 (diff)
enable openpgp2pem as well from keytrans
Diffstat (limited to 'src/share')
-rwxr-xr-xsrc/share/keytrans16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/share/keytrans b/src/share/keytrans
index c09f664..19419e3 100755
--- a/src/share/keytrans
+++ b/src/share/keytrans
@@ -1123,6 +1123,22 @@ for (basename($0)) {
die "No matching key found.\n";
}
}
+ elsif (/^openpgp2pem$/) {
+ my $fpr = shift;
+ my $instream;
+ open($instream,'-');
+ binmode($instream, ":bytes");
+ my $key = openpgp2rsa($instream, $fpr);
+ if (defined($key)) {
+ if ($key->is_private()) {
+ print $key->get_private_key_string();
+ } else {
+ print $key->get_public_key_string();
+ }
+ } else {
+ die "No matching key found.\n";
+ }
+ }
elsif (/^keytrans$/) {
# subcommands when keytrans is invoked directly are UNSUPPORTED,
# UNDOCUMENTED, and WILL NOT BE MAINTAINED.