List of usage examples for org.bouncycastle.bcpg SignatureSubpacketTags TRUST_SIG
int TRUST_SIG
To view the source code for org.bouncycastle.bcpg SignatureSubpacketTags TRUST_SIG.
Click Source Link
From source file:com.google.gerrit.gpg.PublicKeyChecker.java
License:Apache License
private CheckResult checkTrustSubpacket(PGPSignature sig, int depth) { SignatureSubpacket trustSub = sig.getHashedSubPackets().getSubpacket(SignatureSubpacketTags.TRUST_SIG); if (trustSub == null || trustSub.getData().length != 2) { return new CheckResult("Certification is missing trust information"); }// w w w . j av a 2 s .co m byte amount = trustSub.getData()[1]; if (amount < COMPLETE_TRUST) { return new CheckResult("Certification does not fully trust key"); } byte level = trustSub.getData()[0]; int required = depth + 1; if (level < required) { return new CheckResult( "Certification trusts to depth " + level + ", but depth " + required + " is required"); } return CheckResult.OK; }