1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-23 04:42:06 +01:00

Add KeyRingInfo.getExpirationDate(fingerprint) to get subkey exp dates

This commit is contained in:
Paul Schaub 2021-01-18 17:09:34 +01:00
parent 21ba97c598
commit bf8e29caa4
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -215,7 +215,11 @@ public class KeyRingInfo {
* @return expiration date
*/
public Date getExpirationDate() {
long validSeconds = getPublicKey().getValidSeconds();
return getExpirationDate(new OpenPgpV4Fingerprint(getPublicKey()));
}
public Date getExpirationDate(OpenPgpV4Fingerprint fingerprint) {
long validSeconds = keys.getPublicKey(fingerprint.getKeyId()).getValidSeconds();
if (validSeconds == 0) {
return null;
}