From e61d414a98441fca376318a2c662925bfd1875e3 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Fri, 7 Jul 2023 11:26:55 +0200 Subject: [PATCH] Manually checkout SignatureSubpacketsUtil methods for wot --- .../subpackets/SignatureSubpacketsUtil.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pgpainless-core/src/main/java/org/pgpainless/signature/subpackets/SignatureSubpacketsUtil.java b/pgpainless-core/src/main/java/org/pgpainless/signature/subpackets/SignatureSubpacketsUtil.java index e69ea0a7..6d53ad1d 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/signature/subpackets/SignatureSubpacketsUtil.java +++ b/pgpainless-core/src/main/java/org/pgpainless/signature/subpackets/SignatureSubpacketsUtil.java @@ -531,6 +531,11 @@ public final class SignatureSubpacketsUtil { return hashed(signature, SignatureSubpacket.exportableCertification); } + public static boolean isExportable(PGPSignature signature) { + Exportable exportable = getExportableCertification(signature); + return exportable == null || exportable.isExportable(); + } + /** * Return the trust signature packet from the signatures hashed area. * @@ -541,6 +546,22 @@ public final class SignatureSubpacketsUtil { return hashed(signature, SignatureSubpacket.trustSignature); } + public static int getTrustDepthOr(PGPSignature signature, int defaultDepth) { + TrustSignature packet = getTrustSignature(signature); + if (packet != null) { + return packet.getDepth(); + } + return defaultDepth; + } + + public static int getTrustAmountOr(PGPSignature signature, int defaultAmount) { + TrustSignature packet = getTrustSignature(signature); + if (packet != null) { + return packet.getTrustAmount(); + } + return defaultAmount; + } + /** * Return all regular expression subpackets from the hashed area of the given signature. *