mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-25 12:27:58 +01:00
Certification Revocations equate to tsig of 0/0
This commit is contained in:
parent
e6daae2a27
commit
74bccb6c82
1 changed files with 25 additions and 10 deletions
|
@ -5,6 +5,7 @@
|
||||||
package org.pgpainless.wot.util
|
package org.pgpainless.wot.util
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.PGPSignature
|
import org.bouncycastle.openpgp.PGPSignature
|
||||||
|
import org.pgpainless.algorithm.SignatureType
|
||||||
import org.pgpainless.signature.subpackets.SignatureSubpacketsUtil
|
import org.pgpainless.signature.subpackets.SignatureSubpacketsUtil
|
||||||
import org.pgpainless.wot.network.Node
|
import org.pgpainless.wot.network.Node
|
||||||
import org.pgpainless.wot.network.EdgeComponent
|
import org.pgpainless.wot.network.EdgeComponent
|
||||||
|
@ -35,16 +36,30 @@ class CertificationFactory {
|
||||||
target: Node,
|
target: Node,
|
||||||
targetUserId: String?,
|
targetUserId: String?,
|
||||||
signature: PGPSignature): EdgeComponent {
|
signature: PGPSignature): EdgeComponent {
|
||||||
return EdgeComponent(
|
if (signature.signatureType == SignatureType.CERTIFICATION_REVOCATION.code) {
|
||||||
issuer,
|
// Revocations equate to trust of 0/0
|
||||||
target,
|
return EdgeComponent(
|
||||||
targetUserId,
|
issuer,
|
||||||
SignatureSubpacketsUtil.getSignatureCreationTime(signature)!!.time,
|
target,
|
||||||
SignatureSubpacketsUtil.getSignatureExpirationTimeAsDate(signature),
|
targetUserId,
|
||||||
SignatureSubpacketsUtil.isExportable(signature),
|
SignatureSubpacketsUtil.getSignatureCreationTime(signature)!!.time,
|
||||||
getTrustAmountFrom(signature),
|
SignatureSubpacketsUtil.getSignatureExpirationTimeAsDate(signature),
|
||||||
getTrustDepthFrom(signature),
|
SignatureSubpacketsUtil.isExportable(signature),
|
||||||
regexSetFrom(signature))
|
0,
|
||||||
|
Depth.limited(0),
|
||||||
|
regexSetFrom(signature))
|
||||||
|
} else {
|
||||||
|
return EdgeComponent(
|
||||||
|
issuer,
|
||||||
|
target,
|
||||||
|
targetUserId,
|
||||||
|
SignatureSubpacketsUtil.getSignatureCreationTime(signature)!!.time,
|
||||||
|
SignatureSubpacketsUtil.getSignatureExpirationTimeAsDate(signature),
|
||||||
|
SignatureSubpacketsUtil.isExportable(signature),
|
||||||
|
getTrustAmountFrom(signature),
|
||||||
|
getTrustDepthFrom(signature),
|
||||||
|
regexSetFrom(signature))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
|
|
Loading…
Reference in a new issue