mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-09 02:09:38 +02:00
Add missing implementations of then() method
This commit is contained in:
parent
c054cb9705
commit
7313c5e5a9
2 changed files with 39 additions and 2 deletions
|
@ -6,7 +6,22 @@ package org.pgpainless.signature.subpackets
|
|||
|
||||
interface CertificationSubpackets : BaseSignatureSubpackets {
|
||||
|
||||
interface Callback : SignatureSubpacketCallback<CertificationSubpackets>
|
||||
interface Callback : SignatureSubpacketCallback<CertificationSubpackets> {
|
||||
fun then(nextCallback: SignatureSubpacketCallback<CertificationSubpackets>): Callback {
|
||||
val currCallback = this
|
||||
return object : Callback {
|
||||
override fun modifyHashedSubpackets(hashedSubpackets: CertificationSubpackets) {
|
||||
currCallback.modifyHashedSubpackets(hashedSubpackets)
|
||||
nextCallback.modifyHashedSubpackets(hashedSubpackets)
|
||||
}
|
||||
|
||||
override fun modifyUnhashedSubpackets(unhashedSubpackets: CertificationSubpackets) {
|
||||
currCallback.modifyUnhashedSubpackets(unhashedSubpackets)
|
||||
nextCallback.modifyUnhashedSubpackets(unhashedSubpackets)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
|
|
|
@ -6,10 +6,32 @@ package org.pgpainless.signature.subpackets
|
|||
|
||||
import org.bouncycastle.bcpg.sig.RevocationReason
|
||||
import org.pgpainless.key.util.RevocationAttributes
|
||||
import org.pgpainless.signature.subpackets.SelfSignatureSubpackets.Callback
|
||||
|
||||
interface RevocationSignatureSubpackets : BaseSignatureSubpackets {
|
||||
|
||||
interface Callback : SignatureSubpacketCallback<RevocationSignatureSubpackets>
|
||||
interface Callback : SignatureSubpacketCallback<RevocationSignatureSubpackets> {
|
||||
fun then(
|
||||
nextCallback: SignatureSubpacketCallback<RevocationSignatureSubpackets>
|
||||
): Callback {
|
||||
val currCallback = this
|
||||
return object : Callback {
|
||||
override fun modifyHashedSubpackets(
|
||||
hashedSubpackets: RevocationSignatureSubpackets
|
||||
) {
|
||||
currCallback.modifyHashedSubpackets(hashedSubpackets)
|
||||
nextCallback.modifyHashedSubpackets(hashedSubpackets)
|
||||
}
|
||||
|
||||
override fun modifyUnhashedSubpackets(
|
||||
unhashedSubpackets: RevocationSignatureSubpackets
|
||||
) {
|
||||
currCallback.modifyUnhashedSubpackets(unhashedSubpackets)
|
||||
nextCallback.modifyUnhashedSubpackets(unhashedSubpackets)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun setRevocationReason(
|
||||
revocationAttributes: RevocationAttributes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue