1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-16 17:32:06 +01:00

Add PGPSignatureExtensions file

This commit is contained in:
Paul Schaub 2023-08-28 16:18:41 +02:00
parent b33ee90845
commit 85b1ffe2e9
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -0,0 +1,23 @@
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package org.bouncycastle.extensions
import org.bouncycastle.openpgp.PGPSignature
import org.pgpainless.key.OpenPgpFingerprint
import org.pgpainless.signature.SignatureUtils
import java.util.*
fun PGPSignature.getKeyExpirationDate(keyCreationDate: Date): Date? =
SignatureUtils.getKeyExpirationDate(keyCreationDate, this)
fun PGPSignature.getSignatureExpirationDate(): Date? =
SignatureUtils.getSignatureExpirationDate(this)
fun PGPSignature.isExpired(referenceTime: Date = Date()) =
SignatureUtils.isSignatureExpired(this, referenceTime)
fun PGPSignature.getIssuerKeyId() = SignatureUtils.determineIssuerKeyId(this)
fun PGPSignature.wasIssuedBy(fingerprint: OpenPgpFingerprint) = SignatureUtils.wasIssuedBy(fingerprint, this)