mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-26 14:22:05 +01:00
Fix getExpirationDate method for keys without expiration
This commit is contained in:
parent
5ee17fac69
commit
c266adb5a5
1 changed files with 4 additions and 1 deletions
|
@ -210,12 +210,15 @@ public class KeyRingInfo {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return the date of expiration of the primary key.
|
||||
* Return the date of expiration of the primary key or null if the key has no expiration date.
|
||||
*
|
||||
* @return expiration date
|
||||
*/
|
||||
public Date getExpirationDate() {
|
||||
long validSeconds = getPublicKey().getValidSeconds();
|
||||
if (validSeconds == 0) {
|
||||
return null;
|
||||
}
|
||||
return new Date(getCreationDate().getTime() + (1000 * validSeconds));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue