# could an environment variable (if set) override the current time, to
# be able to create a standard key? If we read the key from a file
# instead of stdin, should we use the creation time on the file?
-my $timestamp = $ENV{PEM2OPENPGP_TIMESTAMP};
-if (! defined $timestamp)
+my $timestamp = 0;
+if (defined $ENV{PEM2OPENPGP_TIMESTAMP}) {
+ $timestamp = ($ENV{PEM2OPENPGP_TIMESTAMP} + 0);
+} else {
$timestamp = time();
+}
my $flags = 0;
-if (! defined $ENV{PEM2OPENPGP_USAGE_FLAGS})
+if (! defined $ENV{PEM2OPENPGP_USAGE_FLAGS}) {
$flags = $usage_flags->{authenticate};
-else {
+} else {
my @ff = split(",", $ENV{PEM2OPENPGP_USAGE_FLAGS});
foreach $f (@ff) {
if (! defined $usage_flags->{$f})