-# FIXME: HARDCODED: how should we determine how far off to set the
-# expiration date? default is to expire in 2 days, which is insanely
-# short (but good for testing). The user ought to be able to decide
-# this directly, rather than having to do "monkeysphere-server
-# extend-key".
-my $expires_in = 86400*2;
-my $expiration_packet = pack('CCN', 5, $subpacket_types->{key_expiration_time}, $expires_in);
+
+# how should we determine how far off to set the expiration date?
+# default is no expiration. Specify the timestamp in seconds from the
+# key creation.
+my $expiration_packet = '';
+if (defined $ENV{PEM2OPENPGP_EXPIRATION}) {
+ my $expires_in = $ENV{PEM2OPENPGP_EXPIRATION} + 0;
+ $expiration_packet = pack('CCN', 5, $subpacket_types->{key_expiration_time}, $expires_in);
+}