diff options
-rwxr-xr-x | src/keytrans/pem2openpgp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/keytrans/pem2openpgp b/src/keytrans/pem2openpgp index 37b372a..73becfe 100755 --- a/src/keytrans/pem2openpgp +++ b/src/keytrans/pem2openpgp @@ -724,6 +724,14 @@ for (basename($0)) { if (/^pem2openpgp$/) { my $rsa; my $stdin; + + my $uid = shift; + defined($uid) or die "You must specify a user ID string.\n"; + + # FIXME: fail if there is no given user ID; or should we default to + # hostname_long() from Sys::Hostname::Long ? + + if (defined $ENV{PEM2OPENPGP_NEWKEY}) { $rsa = Crypt::OpenSSL::RSA->generate_key($ENV{PEM2OPENPGP_NEWKEY}); } else { @@ -735,11 +743,6 @@ for (basename($0)) { $rsa = Crypt::OpenSSL::RSA->new_private_key($stdin); } - my $uid = shift; - - # FIXME: fail if there is no given user ID; or should we default to - # hostname_long() from Sys::Hostname::Long ? - print pem2openpgp($rsa, $uid, { timestamp => $ENV{PEM2OPENPGP_TIMESTAMP}, |