mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-12-05 03:41:07 +01:00
SigningOptions: Change map key type to OpenPGPComponentKey
This commit is contained in:
parent
88579d1120
commit
62caa81c6f
2 changed files with 4 additions and 3 deletions
|
|
@ -248,7 +248,7 @@ class EncryptionStream(
|
|||
|
||||
options.signingOptions.signingMethods.entries.reversed().forEach { (key, method) ->
|
||||
method.signatureGenerator.generate().let { sig ->
|
||||
val documentSignature = OpenPGPDocumentSignature(sig, key.publicKey)
|
||||
val documentSignature = OpenPGPDocumentSignature(sig, key)
|
||||
if (method.isDetached) {
|
||||
resultBuilder.addDetachedSignature(documentSignature)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ package org.pgpainless.encryption_signing
|
|||
import java.util.*
|
||||
import org.bouncycastle.bcpg.KeyIdentifier
|
||||
import org.bouncycastle.openpgp.*
|
||||
import org.bouncycastle.openpgp.api.OpenPGPCertificate.OpenPGPComponentKey
|
||||
import org.bouncycastle.openpgp.api.OpenPGPImplementation
|
||||
import org.bouncycastle.openpgp.api.OpenPGPKey
|
||||
import org.bouncycastle.openpgp.api.OpenPGPKey.OpenPGPPrivateKey
|
||||
|
|
@ -30,7 +31,7 @@ import org.pgpainless.signature.subpackets.SignatureSubpacketsHelper
|
|||
class SigningOptions(private val api: PGPainless) {
|
||||
var hashAlgorithmNegotiator: HashAlgorithmNegotiator =
|
||||
negotiateSignatureHashAlgorithm(api.algorithmPolicy)
|
||||
val signingMethods: Map<OpenPGPPrivateKey, SigningMethod> = mutableMapOf()
|
||||
val signingMethods: Map<OpenPGPComponentKey, SigningMethod> = mutableMapOf()
|
||||
private var _hashAlgorithmOverride: HashAlgorithm? = null
|
||||
private var _evaluationDate: Date = Date()
|
||||
|
||||
|
|
@ -525,7 +526,7 @@ class SigningOptions(private val api: PGPainless) {
|
|||
publicKeyAlgorithm, bitStrength)) {
|
||||
throw UnacceptableSigningKeyException(
|
||||
PublicKeyAlgorithmPolicyException(
|
||||
signingKey.secretKey, publicKeyAlgorithm, bitStrength))
|
||||
signingKey, publicKeyAlgorithm, bitStrength))
|
||||
}
|
||||
|
||||
val generator: PGPSignatureGenerator =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue