1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-22 19:08:00 +01:00

Manually checkout SignatureSubpacketsUtil methods for wot

This commit is contained in:
Paul Schaub 2023-07-07 11:26:55 +02:00
parent 6487cf2371
commit e61d414a98
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -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.
*