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

Add missing method implementations

This commit is contained in:
Paul Schaub 2025-03-06 09:26:35 +01:00
parent 1141bdf1f8
commit b5386d844e
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
3 changed files with 9 additions and 4 deletions

View file

@ -90,9 +90,9 @@ class SecretKeyRingEditor(var key: OpenPGPKey, override val referenceTime: Date
} }
builder.hashedSubpackets.apply { builder.hashedSubpackets.apply {
setKeyFlags(info.getKeyFlagsOf(primaryKey.keyID)) setKeyFlags(info.getKeyFlagsOf(primaryKey.keyID))
setPreferredHashAlgorithms(hashAlgorithmPreferences) hashAlgorithmPreferences?.let { setPreferredHashAlgorithms(it) }
setPreferredSymmetricKeyAlgorithms(symmetricKeyAlgorithmPreferences) symmetricKeyAlgorithmPreferences?.let { setPreferredSymmetricKeyAlgorithms(it) }
setPreferredCompressionAlgorithms(compressionAlgorithmPreferences) compressionAlgorithmPreferences?.let { setPreferredCompressionAlgorithms(it) }
setFeatures(Feature.MODIFICATION_DETECTION) setFeatures(Feature.MODIFICATION_DETECTION)
} }
builder.applyCallback(callback) builder.applyCallback(callback)

View file

@ -112,7 +112,7 @@ interface SelfSignatureSubpackets : BaseSignatureSubpackets {
fun setPreferredHashAlgorithms(algorithms: PreferredAlgorithms?): SelfSignatureSubpackets fun setPreferredHashAlgorithms(algorithms: PreferredAlgorithms?): SelfSignatureSubpackets
fun setPreferredAEADCiphersuites(aeadAlgorithms: Set<AEADCipherMode>) fun setPreferredAEADCiphersuites(aeadAlgorithms: Set<AEADCipherMode>): SelfSignatureSubpackets
fun addRevocationKey(revocationKey: PGPPublicKey): SelfSignatureSubpackets fun addRevocationKey(revocationKey: PGPPublicKey): SelfSignatureSubpackets

View file

@ -42,6 +42,7 @@ class SignatureSubpackets :
var preferredCompressionAlgorithmsSubpacket: PreferredAlgorithms? = null var preferredCompressionAlgorithmsSubpacket: PreferredAlgorithms? = null
var preferredSymmetricKeyAlgorithmsSubpacket: PreferredAlgorithms? = null var preferredSymmetricKeyAlgorithmsSubpacket: PreferredAlgorithms? = null
var preferredHashAlgorithmsSubpacket: PreferredAlgorithms? = null var preferredHashAlgorithmsSubpacket: PreferredAlgorithms? = null
var preferredAEADCiphersuites: List<AEADCipherMode>? = null
val embeddedSignatureSubpackets: List<EmbeddedSignature> = mutableListOf() val embeddedSignatureSubpackets: List<EmbeddedSignature> = mutableListOf()
var signerUserIdSubpacket: SignerUserID? = null var signerUserIdSubpacket: SignerUserID? = null
var keyExpirationTimeSubpacket: KeyExpirationTime? = null var keyExpirationTimeSubpacket: KeyExpirationTime? = null
@ -312,6 +313,10 @@ class SignatureSubpackets :
this.preferredHashAlgorithmsSubpacket = algorithms this.preferredHashAlgorithmsSubpacket = algorithms
} }
override fun setPreferredAEADCiphersuites(
aeadAlgorithms: Set<AEADCipherMode>
): SignatureSubpackets = apply { this.preferredAEADCiphersuites = aeadAlgorithms.toList() }
override fun addRevocationKey(revocationKey: PGPPublicKey): SignatureSubpackets = apply { override fun addRevocationKey(revocationKey: PGPPublicKey): SignatureSubpackets = apply {
addRevocationKey(true, revocationKey) addRevocationKey(true, revocationKey)
} }