1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-25 12:27:58 +01:00

Add PGPSignatureExtensions file

This commit is contained in:
Paul Schaub 2023-08-28 16:18:41 +02:00
parent 0a1f67802a
commit c759367680
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)