summaryrefslogtreecommitdiff
path: root/src/keytrans/pem2openpgp
diff options
context:
space:
mode:
authorMatt Goins <mjgoins@openflows.com>2009-02-09 21:54:58 -0500
committerMatt Goins <mjgoins@openflows.com>2009-02-09 21:54:58 -0500
commit3b81cd012e8224490a3836cccbd7d082a061658e (patch)
tree71fa874a6a98680388ff7a8b1a6e478390bd5b1d /src/keytrans/pem2openpgp
parentc9a361eecab5ea18d0b868580a3d0703517ab677 (diff)
parentd71cf8d24bd9357a016b1ead375a67ccd955c130 (diff)
Merge commit 'jrollins/master'
Diffstat (limited to 'src/keytrans/pem2openpgp')
-rwxr-xr-xsrc/keytrans/pem2openpgp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/keytrans/pem2openpgp b/src/keytrans/pem2openpgp
index c765002..2631da6 100755
--- a/src/keytrans/pem2openpgp
+++ b/src/keytrans/pem2openpgp
@@ -347,13 +347,16 @@ sub fingerprint {
return Digest::SHA1::sha1(pack('Cn', 0x99, length($rsabody)).$rsabody);
}
-# we're just not dealing with newline business right now. slurp in
-# the whole file.
-undef $/;
-my $buf = <STDIN>;
-
-my $rsa = Crypt::OpenSSL::RSA->new_private_key($buf);
+my $rsa;
+if (defined $ENV{PEM2OPENPGP_NEWKEY}) {
+ $rsa = Crypt::OpenSSL::RSA->generate_key($ENV{PEM2OPENPGP_NEWKEY});
+} else {
+ # we're just not dealing with newline business right now. slurp in
+ # the whole file.
+ undef $/;
+ $rsa = Crypt::OpenSSL::RSA->new_private_key(<STDIN>);
+}
$rsa->use_sha1_hash();