Skip to content

Commit

Permalink
Fixed PGP key expiration logic when encrypting
Browse files Browse the repository at this point in the history
Fixes issue #194
  • Loading branch information
jstedfast committed Dec 8, 2015
1 parent 1305d20 commit 1d34510
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MimeKit/Cryptography/OpenPgpContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ protected virtual PgpPublicKey GetPublicKey (MailboxAddress mailbox)
long seconds = key.GetValidSeconds ();
if (seconds != 0) {
var expires = key.CreationTime.AddSeconds ((double) seconds);
if (expires >= DateTime.Now)
if (expires <= DateTime.Now)
continue;
}

Expand Down Expand Up @@ -531,7 +531,7 @@ protected virtual PgpSecretKey GetSigningKey (MailboxAddress mailbox)
long seconds = pubkey.GetValidSeconds ();
if (seconds != 0) {
var expires = pubkey.CreationTime.AddSeconds ((double) seconds);
if (DateTime.Now >= expires)
if (expires <= DateTime.Now)
continue;
}

Expand Down

0 comments on commit 1d34510

Please sign in to comment.