Search in sources :

Example 1 with QaInhibitAnyPolicy

use of org.xipki.ca.qa.internal.QaInhibitAnyPolicy in project xipki by xipki.

the class ExtensionsChecker method checkExtensionInhibitAnyPolicy.

// method checkExtensionPolicyMappings
private void checkExtensionInhibitAnyPolicy(StringBuilder failureMsg, byte[] extensionValue, Extensions requestedExtensions, ExtensionControl extControl) {
    QaInhibitAnyPolicy conf = inhibitAnyPolicy;
    if (conf == null) {
        byte[] expected = getExpectedExtValue(Extension.inhibitAnyPolicy, requestedExtensions, extControl);
        if (!Arrays.equals(expected, extensionValue)) {
            addViolation(failureMsg, "extension values", extensionValue, (expected == null) ? "not present" : hex(expected));
        }
        return;
    }
    ASN1Integer asn1Int = ASN1Integer.getInstance(extensionValue);
    int isSkipCerts = asn1Int.getPositiveValue().intValue();
    if (isSkipCerts != conf.getSkipCerts()) {
        addViolation(failureMsg, "skipCerts", isSkipCerts, conf.getSkipCerts());
    }
}
Also used : ASN1Integer(org.bouncycastle.asn1.ASN1Integer) QaInhibitAnyPolicy(org.xipki.ca.qa.internal.QaInhibitAnyPolicy) CRLDistPoint(org.bouncycastle.asn1.x509.CRLDistPoint) DistributionPoint(org.bouncycastle.asn1.x509.DistributionPoint)

Aggregations

ASN1Integer (org.bouncycastle.asn1.ASN1Integer)1 CRLDistPoint (org.bouncycastle.asn1.x509.CRLDistPoint)1 DistributionPoint (org.bouncycastle.asn1.x509.DistributionPoint)1 QaInhibitAnyPolicy (org.xipki.ca.qa.internal.QaInhibitAnyPolicy)1