1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-09-09 18:29:39 +02:00

Clean up OnePassSignatureCheck

This commit is contained in:
Paul Schaub 2025-05-08 12:57:59 +02:00
parent 3340614595
commit 8cb94a8924
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -7,9 +7,6 @@ package org.pgpainless.signature.consumer
import org.bouncycastle.openpgp.PGPOnePassSignature import org.bouncycastle.openpgp.PGPOnePassSignature
import org.bouncycastle.openpgp.PGPSignature import org.bouncycastle.openpgp.PGPSignature
import org.bouncycastle.openpgp.api.OpenPGPCertificate import org.bouncycastle.openpgp.api.OpenPGPCertificate
import org.bouncycastle.openpgp.api.OpenPGPCertificate.OpenPGPComponentKey
import org.pgpainless.bouncycastle.extensions.getSigningKeyFor
import org.pgpainless.key.SubkeyIdentifier
/** /**
* Tuple-class that bundles together a [PGPOnePassSignature] object, an [OpenPGPCertificate] * Tuple-class that bundles together a [PGPOnePassSignature] object, an [OpenPGPCertificate]
@ -24,19 +21,4 @@ data class OnePassSignatureCheck(
) { ) {
var signature: PGPSignature? = null var signature: PGPSignature? = null
constructor(
onePassSignature: PGPOnePassSignature,
verificationKey: OpenPGPComponentKey
) : this(onePassSignature, verificationKey.certificate)
val signingKey: OpenPGPComponentKey? = verificationKeys.getSigningKeyFor(onePassSignature)
/**
* Return an identifier for the signing key.
*
* @return signing key fingerprint
*/
val signingKeyIdentifier: SubkeyIdentifier?
get() = signingKey?.let { SubkeyIdentifier(it) }
} }