mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-05 12:05:58 +01:00
Add PGPSignatureExtensions file
This commit is contained in:
parent
0a1f67802a
commit
c759367680
1 changed files with 23 additions and 0 deletions
|
@ -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)
|
Loading…
Reference in a new issue