mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-09 10:19:39 +02:00
setPreferredAEADCiphersuites(): Add missing method taking PreferredAEADCiphersuites object
This commit is contained in:
parent
9a8ecb7fa0
commit
2270c69af7
3 changed files with 17 additions and 3 deletions
|
@ -121,6 +121,10 @@ interface SelfSignatureSubpackets : BaseSignatureSubpackets {
|
||||||
algorithms: PreferredAEADCiphersuites.Builder?
|
algorithms: PreferredAEADCiphersuites.Builder?
|
||||||
): SelfSignatureSubpackets
|
): SelfSignatureSubpackets
|
||||||
|
|
||||||
|
fun setPreferredAEADCiphersuites(
|
||||||
|
preferredAEADCiphersuites: PreferredAEADCiphersuites?
|
||||||
|
): SelfSignatureSubpackets
|
||||||
|
|
||||||
@Deprecated("Use of this subpacket is discouraged.")
|
@Deprecated("Use of this subpacket is discouraged.")
|
||||||
fun addRevocationKey(revocationKey: PGPPublicKey): SelfSignatureSubpackets
|
fun addRevocationKey(revocationKey: PGPPublicKey): SelfSignatureSubpackets
|
||||||
|
|
||||||
|
|
|
@ -281,9 +281,15 @@ class SignatureSubpackets(
|
||||||
|
|
||||||
override fun setPreferredAEADCiphersuites(
|
override fun setPreferredAEADCiphersuites(
|
||||||
algorithms: PreferredAEADCiphersuites.Builder?
|
algorithms: PreferredAEADCiphersuites.Builder?
|
||||||
): SignatureSubpackets = apply {
|
): SignatureSubpackets = setPreferredAEADCiphersuites(algorithms?.build())
|
||||||
|
|
||||||
|
override fun setPreferredAEADCiphersuites(
|
||||||
|
preferredAEADCiphersuites: PreferredAEADCiphersuites?
|
||||||
|
) = apply {
|
||||||
subpacketsGenerator.removePacketsOfType(SignatureSubpacketTags.PREFERRED_AEAD_ALGORITHMS)
|
subpacketsGenerator.removePacketsOfType(SignatureSubpacketTags.PREFERRED_AEAD_ALGORITHMS)
|
||||||
algorithms?.let { subpacketsGenerator.setPreferredAEADCiphersuites(algorithms) }
|
preferredAEADCiphersuites?.let {
|
||||||
|
subpacketsGenerator.setPreferredAEADCiphersuites(it.isCritical, it.rawAlgorithms)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun addRevocationKey(revocationKey: PGPPublicKey): SignatureSubpackets = apply {
|
override fun addRevocationKey(revocationKey: PGPPublicKey): SignatureSubpackets = apply {
|
||||||
|
|
|
@ -61,6 +61,11 @@ class SignatureSubpacketsHelper {
|
||||||
PreferredAlgorithms(
|
PreferredAlgorithms(
|
||||||
it.type, it.isCritical, it.isLongLength, it.data))
|
it.type, it.isCritical, it.isLongLength, it.data))
|
||||||
}
|
}
|
||||||
|
SignatureSubpacket.preferredAEADAlgorithms ->
|
||||||
|
(subpacket as PreferredAEADCiphersuites).let {
|
||||||
|
subpackets.setPreferredAEADCiphersuites(
|
||||||
|
PreferredAEADCiphersuites(it.isCritical, it.rawAlgorithms))
|
||||||
|
}
|
||||||
SignatureSubpacket.revocationKey ->
|
SignatureSubpacket.revocationKey ->
|
||||||
(subpacket as RevocationKey).let {
|
(subpacket as RevocationKey).let {
|
||||||
subpackets.addRevocationKey(
|
subpackets.addRevocationKey(
|
||||||
|
@ -130,7 +135,6 @@ class SignatureSubpacketsHelper {
|
||||||
SignatureSubpacket.keyServerPreferences,
|
SignatureSubpacket.keyServerPreferences,
|
||||||
SignatureSubpacket.preferredKeyServers,
|
SignatureSubpacket.preferredKeyServers,
|
||||||
SignatureSubpacket.placeholder,
|
SignatureSubpacket.placeholder,
|
||||||
SignatureSubpacket.preferredAEADAlgorithms,
|
|
||||||
SignatureSubpacket.attestedCertification ->
|
SignatureSubpacket.attestedCertification ->
|
||||||
subpackets.addResidualSubpacket(subpacket)
|
subpackets.addResidualSubpacket(subpacket)
|
||||||
else -> subpackets.addResidualSubpacket(subpacket)
|
else -> subpackets.addResidualSubpacket(subpacket)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue