mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-19 02:42:05 +01:00
Add PGPSignatureExtensions file
This commit is contained in:
parent
b33ee90845
commit
85b1ffe2e9
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