Java 类org.bouncycastle.asn1.x509.IssuingDistributionPoint 实例源码

项目:gwt-crypto    文件:IssuingDistributionPointUnitTest.java   
public void performTest()
    throws Exception
{
    DistributionPointName    name = new DistributionPointName(
                                          new GeneralNames(new GeneralName(new X500Name("cn=test"))));
    ReasonFlags reasonFlags = new ReasonFlags(ReasonFlags.cACompromise);

    checkPoint(6, name, true, true, reasonFlags, true, true);

    checkPoint(2, name, false, false, reasonFlags, false, false);

    checkPoint(0, null, false, false, null, false, false);

    try
    {
        IssuingDistributionPoint.getInstance(new Object());

        fail("getInstance() failed to detect bad object.");
    }
    catch (IllegalArgumentException e)
    {
        // expected
    }
}
项目:gwt-crypto    文件:IssuingDistributionPointUnitTest.java   
private void checkPoint(
    int size,
    DistributionPointName distributionPoint,
    boolean onlyContainsUserCerts,
    boolean onlyContainsCACerts,
    ReasonFlags onlySomeReasons,
    boolean indirectCRL,
    boolean onlyContainsAttributeCerts)
    throws IOException
{
    IssuingDistributionPoint point = new IssuingDistributionPoint(distributionPoint, onlyContainsUserCerts, onlyContainsCACerts, onlySomeReasons, indirectCRL, onlyContainsAttributeCerts);

    checkValues(point, distributionPoint, onlyContainsUserCerts, onlyContainsCACerts, onlySomeReasons, indirectCRL, onlyContainsAttributeCerts);

    ASN1Sequence seq = ASN1Sequence.getInstance(ASN1Primitive.fromByteArray(point.getEncoded()));

    if (seq.size() != size)
    {
        fail("size mismatch");
    }

    point = IssuingDistributionPoint.getInstance(seq);

    checkValues(point, distributionPoint, onlyContainsUserCerts, onlyContainsCACerts, onlySomeReasons, indirectCRL, onlyContainsAttributeCerts);
}
项目:irma_future_id    文件:IssuingDistributionPointUnitTest.java   
public void performTest()
    throws Exception
{
    DistributionPointName    name = new DistributionPointName(
                                          new GeneralNames(new GeneralName(new X509Name("cn=test"))));
    ReasonFlags reasonFlags = new ReasonFlags(ReasonFlags.cACompromise);

    checkPoint(6, name, true, true, reasonFlags, true, true);

    checkPoint(2, name, false, false, reasonFlags, false, false);

    checkPoint(0, null, false, false, null, false, false);

    try
    {
        IssuingDistributionPoint.getInstance(new Object());

        fail("getInstance() failed to detect bad object.");
    }
    catch (IllegalArgumentException e)
    {
        // expected
    }
}
项目:irma_future_id    文件:IssuingDistributionPointUnitTest.java   
private void checkPoint(
    int size,
    DistributionPointName distributionPoint,
    boolean onlyContainsUserCerts,
    boolean onlyContainsCACerts,
    ReasonFlags onlySomeReasons,
    boolean indirectCRL,
    boolean onlyContainsAttributeCerts)
    throws IOException
{
    IssuingDistributionPoint point = new IssuingDistributionPoint(distributionPoint, onlyContainsUserCerts, onlyContainsCACerts, onlySomeReasons, indirectCRL, onlyContainsAttributeCerts);

    checkValues(point, distributionPoint, onlyContainsUserCerts, onlyContainsCACerts, onlySomeReasons, indirectCRL, onlyContainsAttributeCerts);

    ASN1Sequence seq = ASN1Sequence.getInstance(ASN1Primitive.fromByteArray(point.getEncoded()));

    if (seq.size() != size)
    {
        fail("size mismatch");
    }

    point = IssuingDistributionPoint.getInstance(seq);

    checkValues(point, distributionPoint, onlyContainsUserCerts, onlyContainsCACerts, onlySomeReasons, indirectCRL, onlyContainsAttributeCerts);
}
项目:bc-java    文件:IssuingDistributionPointUnitTest.java   
public void performTest()
    throws Exception
{
    DistributionPointName    name = new DistributionPointName(
                                          new GeneralNames(new GeneralName(new X509Name("cn=test"))));
    ReasonFlags reasonFlags = new ReasonFlags(ReasonFlags.cACompromise);

    checkPoint(6, name, true, true, reasonFlags, true, true);

    checkPoint(2, name, false, false, reasonFlags, false, false);

    checkPoint(0, null, false, false, null, false, false);

    try
    {
        IssuingDistributionPoint.getInstance(new Object());

        fail("getInstance() failed to detect bad object.");
    }
    catch (IllegalArgumentException e)
    {
        // expected
    }
}
项目:bc-java    文件:IssuingDistributionPointUnitTest.java   
private void checkPoint(
    int size,
    DistributionPointName distributionPoint,
    boolean onlyContainsUserCerts,
    boolean onlyContainsCACerts,
    ReasonFlags onlySomeReasons,
    boolean indirectCRL,
    boolean onlyContainsAttributeCerts)
    throws IOException
{
    IssuingDistributionPoint point = new IssuingDistributionPoint(distributionPoint, onlyContainsUserCerts, onlyContainsCACerts, onlySomeReasons, indirectCRL, onlyContainsAttributeCerts);

    checkValues(point, distributionPoint, onlyContainsUserCerts, onlyContainsCACerts, onlySomeReasons, indirectCRL, onlyContainsAttributeCerts);

    ASN1Sequence seq = ASN1Sequence.getInstance(ASN1Primitive.fromByteArray(point.getEncoded()));

    if (seq.size() != size)
    {
        fail("size mismatch");
    }

    point = IssuingDistributionPoint.getInstance(seq);

    checkValues(point, distributionPoint, onlyContainsUserCerts, onlyContainsCACerts, onlySomeReasons, indirectCRL, onlyContainsAttributeCerts);
}
项目:ipack    文件:X509CRLHolder.java   
private static boolean isIndirectCRL(Extensions extensions)
{
    if (extensions == null)
    {
        return false;
    }

    Extension ext = extensions.getExtension(Extension.issuingDistributionPoint);

    return ext != null && IssuingDistributionPoint.getInstance(ext.getParsedValue()).isIndirectCRL();
}
项目:ipack    文件:X509CRLObject.java   
static boolean isIndirectCRL(X509CRL crl)
    throws CRLException
{
    try
    {
        byte[] idp = crl.getExtensionValue(Extension.issuingDistributionPoint.getId());
        return idp != null
            && IssuingDistributionPoint.getInstance(ASN1OctetString.getInstance(idp).getOctets()).isIndirectCRL();
    }
    catch (Exception e)
    {
        throw new ExtCRLException(
                "Exception reading IssuingDistributionPoint", e);
    }
}
项目:ipack    文件:RFC3280CertPathUtilities.java   
protected static ReasonsMask processCRLD(
    X509CRL crl,
    DistributionPoint dp)
    throws AnnotatedException
{
    IssuingDistributionPoint idp = null;
    try
    {
        idp = IssuingDistributionPoint.getInstance(CertPathValidatorUtilities.getExtensionValue(crl,
            RFC3280CertPathUtilities.ISSUING_DISTRIBUTION_POINT));
    }
    catch (Exception e)
    {
        throw new AnnotatedException("Issuing distribution point extension could not be decoded.", e);
    }
    // (d) (1)
    if (idp != null && idp.getOnlySomeReasons() != null && dp.getReasons() != null)
    {
        return new ReasonsMask(dp.getReasons()).intersect(new ReasonsMask(idp.getOnlySomeReasons()));
    }
    // (d) (4)
    if ((idp == null || idp.getOnlySomeReasons() == null) && dp.getReasons() == null)
    {
        return ReasonsMask.allReasons;
    }
    // (d) (2) and (d)(3)
    return (dp.getReasons() == null
        ? ReasonsMask.allReasons
        : new ReasonsMask(dp.getReasons())).intersect(idp == null
        ? ReasonsMask.allReasons
        : new ReasonsMask(idp.getOnlySomeReasons()));

}
项目:ipack    文件:X509CRLObject.java   
static boolean isIndirectCRL(X509CRL crl)
    throws CRLException
{
    try
    {
        byte[] idp = crl.getExtensionValue(Extension.issuingDistributionPoint.getId());
        return idp != null
            && IssuingDistributionPoint.getInstance(ASN1OctetString.getInstance(idp).getOctets()).isIndirectCRL();
    }
    catch (Exception e)
    {
        throw new ExtCRLException(
                "Exception reading IssuingDistributionPoint", e);
    }
}
项目:gwt-crypto    文件:X509CRLHolder.java   
private static boolean isIndirectCRL(Extensions extensions)
{
    if (extensions == null)
    {
        return false;
    }

    Extension ext = extensions.getExtension(Extension.issuingDistributionPoint);

    return ext != null && IssuingDistributionPoint.getInstance(ext.getParsedValue()).isIndirectCRL();
}
项目:gwt-crypto    文件:IssuingDistributionPointUnitTest.java   
private void checkValues(IssuingDistributionPoint point, DistributionPointName distributionPoint, boolean onlyContainsUserCerts, boolean onlyContainsCACerts, ReasonFlags onlySomeReasons, boolean indirectCRL, boolean onlyContainsAttributeCerts)
{
    if (point.onlyContainsUserCerts() != onlyContainsUserCerts)
    {
        fail("mismatch on onlyContainsUserCerts");
    }

    if (point.onlyContainsCACerts() != onlyContainsCACerts)
    {
        fail("mismatch on onlyContainsCACerts");
    }

    if (point.isIndirectCRL() != indirectCRL)
    {
        fail("mismatch on indirectCRL");
    }

    if (point.onlyContainsAttributeCerts() != onlyContainsAttributeCerts)
    {
        fail("mismatch on onlyContainsAttributeCerts");
    }

    if (!isEquiv(onlySomeReasons, point.getOnlySomeReasons()))
    {
        fail("mismatch on onlySomeReasons");
    }

    if (!isEquiv(distributionPoint, point.getDistributionPoint()))
    {
        fail("mismatch on distributionPoint");
    }
}
项目:Aki-SSL    文件:CertPathValidatorUtilities.java   
static boolean isIndirectCRL(X509CRL crl)
    throws CRLException
{
    try
    {
        byte[] idp = crl.getExtensionValue(Extension.issuingDistributionPoint.getId());
        return idp != null
            && IssuingDistributionPoint.getInstance(ASN1OctetString.getInstance(idp).getOctets()).isIndirectCRL();
    }
    catch (Exception e)
    {
        throw new CRLException(
                "Exception reading IssuingDistributionPoint: " + e);
    }
}
项目:Aki-SSL    文件:X509CRLHolder.java   
private static boolean isIndirectCRL(Extensions extensions)
{
    if (extensions == null)
    {
        return false;
    }

    Extension ext = extensions.getExtension(Extension.issuingDistributionPoint);

    return ext != null && IssuingDistributionPoint.getInstance(ext.getParsedValue()).isIndirectCRL();
}
项目:Aki-SSL    文件:X509CRLObject.java   
public static boolean isIndirectCRL(X509CRL crl)
    throws CRLException
{
    try
    {
        byte[] idp = crl.getExtensionValue(Extension.issuingDistributionPoint.getId());
        return idp != null
            && IssuingDistributionPoint.getInstance(ASN1OctetString.getInstance(idp).getOctets()).isIndirectCRL();
    }
    catch (Exception e)
    {
        throw new ExtCRLException(
                "Exception reading IssuingDistributionPoint", e);
    }
}
项目:Aki-SSL    文件:RFC3280CertPathUtilities.java   
protected static ReasonsMask processCRLD(
    X509CRL crl,
    DistributionPoint dp)
    throws AnnotatedException
{
    IssuingDistributionPoint idp = null;
    try
    {
        idp = IssuingDistributionPoint.getInstance(CertPathValidatorUtilities.getExtensionValue(crl,
            RFC3280CertPathUtilities.ISSUING_DISTRIBUTION_POINT));
    }
    catch (Exception e)
    {
        throw new AnnotatedException("Issuing distribution point extension could not be decoded.", e);
    }
    // (d) (1)
    if (idp != null && idp.getOnlySomeReasons() != null && dp.getReasons() != null)
    {
        return new ReasonsMask(dp.getReasons()).intersect(new ReasonsMask(idp.getOnlySomeReasons()));
    }
    // (d) (4)
    if ((idp == null || idp.getOnlySomeReasons() == null) && dp.getReasons() == null)
    {
        return ReasonsMask.allReasons;
    }
    // (d) (2) and (d)(3)
    return (dp.getReasons() == null
        ? ReasonsMask.allReasons
        : new ReasonsMask(dp.getReasons())).intersect(idp == null
        ? ReasonsMask.allReasons
        : new ReasonsMask(idp.getOnlySomeReasons()));

}
项目:Aki-SSL    文件:X509CRLObject.java   
static boolean isIndirectCRL(X509CRL crl)
    throws CRLException
{
    try
    {
        byte[] idp = crl.getExtensionValue(Extension.issuingDistributionPoint.getId());
        return idp != null
            && IssuingDistributionPoint.getInstance(ASN1OctetString.getInstance(idp).getOctets()).isIndirectCRL();
    }
    catch (Exception e)
    {
        throw new ExtCRLException(
                "Exception reading IssuingDistributionPoint", e);
    }
}
项目:dss    文件:AbstractCRLUtils.java   
protected void checkCriticalExtensions(CRLValidity validity, Collection<String> criticalExtensionsOid, byte[] issuingDistributionPointBinary) {
    if (criticalExtensionsOid == null || criticalExtensionsOid.isEmpty()) {
        validity.setUnknownCriticalExtension(false);
    } else {
        IssuingDistributionPoint issuingDistributionPoint = IssuingDistributionPoint
                .getInstance(ASN1OctetString.getInstance(issuingDistributionPointBinary).getOctets());
        final boolean onlyAttributeCerts = issuingDistributionPoint.onlyContainsAttributeCerts();
        final boolean onlyCaCerts = issuingDistributionPoint.onlyContainsCACerts();
        final boolean onlyUserCerts = issuingDistributionPoint.onlyContainsUserCerts();
        final boolean indirectCrl = issuingDistributionPoint.isIndirectCRL();
        ReasonFlags onlySomeReasons = issuingDistributionPoint.getOnlySomeReasons();
        DistributionPointName distributionPoint = issuingDistributionPoint.getDistributionPoint();
        boolean urlFound = false;
        if (DistributionPointName.FULL_NAME == distributionPoint.getType()) {
            final GeneralNames generalNames = (GeneralNames) distributionPoint.getName();
            if ((generalNames != null) && (generalNames.getNames() != null && generalNames.getNames().length > 0)) {
                for (GeneralName generalName : generalNames.getNames()) {
                    if (GeneralName.uniformResourceIdentifier == generalName.getTagNo()) {
                        ASN1String str = (ASN1String) ((DERTaggedObject) generalName.toASN1Primitive()).getObject();
                        validity.setUrl(str.getString());
                        urlFound = true;
                    }
                }
            }
        }

        if (!(onlyAttributeCerts && onlyCaCerts && onlyUserCerts && indirectCrl) && (onlySomeReasons == null) && urlFound) {
            validity.setUnknownCriticalExtension(false);
        }
    }
}
项目:jtrust    文件:CrlTrustLinker.java   
private boolean isIndirectCRL(X509CRL crl) {
    byte[] idp = crl.getExtensionValue(Extension.issuingDistributionPoint
            .getId());
    boolean isIndirect = false;
    if (idp != null) {
        isIndirect = IssuingDistributionPoint.getInstance(idp)
                .isIndirectCRL();
    }

    return isIndirect;
}
项目:CryptMeme    文件:X509CRLObject.java   
static boolean isIndirectCRL(X509CRL crl)
    throws CRLException
{
    try
    {
        byte[] idp = crl.getExtensionValue(Extension.issuingDistributionPoint.getId());
        return idp != null
            && IssuingDistributionPoint.getInstance(ASN1OctetString.getInstance(idp).getOctets()).isIndirectCRL();
    }
    catch (Exception e)
    {
        throw new ExtCRLException(
                "Exception reading IssuingDistributionPoint", e);
    }
}
项目:CryptMeme    文件:RFC3280CertPathUtilities.java   
protected static ReasonsMask processCRLD(
    X509CRL crl,
    DistributionPoint dp)
    throws AnnotatedException
{
    IssuingDistributionPoint idp = null;
    try
    {
        idp = IssuingDistributionPoint.getInstance(CertPathValidatorUtilities.getExtensionValue(crl,
            RFC3280CertPathUtilities.ISSUING_DISTRIBUTION_POINT));
    }
    catch (Exception e)
    {
        throw new AnnotatedException("Issuing distribution point extension could not be decoded.", e);
    }
    // (d) (1)
    if (idp != null && idp.getOnlySomeReasons() != null && dp.getReasons() != null)
    {
        return new ReasonsMask(dp.getReasons()).intersect(new ReasonsMask(idp.getOnlySomeReasons()));
    }
    // (d) (4)
    if ((idp == null || idp.getOnlySomeReasons() == null) && dp.getReasons() == null)
    {
        return ReasonsMask.allReasons;
    }
    // (d) (2) and (d)(3)
    return (dp.getReasons() == null
        ? ReasonsMask.allReasons
        : new ReasonsMask(dp.getReasons())).intersect(idp == null
        ? ReasonsMask.allReasons
        : new ReasonsMask(idp.getOnlySomeReasons()));

}
项目:CryptMeme    文件:X509CRLObject.java   
static boolean isIndirectCRL(X509CRL crl)
    throws CRLException
{
    try
    {
        byte[] idp = crl.getExtensionValue(Extension.issuingDistributionPoint.getId());
        return idp != null
            && IssuingDistributionPoint.getInstance(ASN1OctetString.getInstance(idp).getOctets()).isIndirectCRL();
    }
    catch (Exception e)
    {
        throw new ExtCRLException(
                "Exception reading IssuingDistributionPoint", e);
    }
}
项目:irma_future_id    文件:X509CRLHolder.java   
private static boolean isIndirectCRL(Extensions extensions)
{
    if (extensions == null)
    {
        return false;
    }

    Extension ext = extensions.getExtension(Extension.issuingDistributionPoint);

    return ext != null && IssuingDistributionPoint.getInstance(ext.getParsedValue()).isIndirectCRL();
}
项目:irma_future_id    文件:IssuingDistributionPointUnitTest.java   
private void checkValues(IssuingDistributionPoint point, DistributionPointName distributionPoint, boolean onlyContainsUserCerts, boolean onlyContainsCACerts, ReasonFlags onlySomeReasons, boolean indirectCRL, boolean onlyContainsAttributeCerts)
{
    if (point.onlyContainsUserCerts() != onlyContainsUserCerts)
    {
        fail("mismatch on onlyContainsUserCerts");
    }

    if (point.onlyContainsCACerts() != onlyContainsCACerts)
    {
        fail("mismatch on onlyContainsCACerts");
    }

    if (point.isIndirectCRL() != indirectCRL)
    {
        fail("mismatch on indirectCRL");
    }

    if (point.onlyContainsAttributeCerts() != onlyContainsAttributeCerts)
    {
        fail("mismatch on onlyContainsAttributeCerts");
    }

    if (!isEquiv(onlySomeReasons, point.getOnlySomeReasons()))
    {
        fail("mismatch on onlySomeReasons");
    }

    if (!isEquiv(distributionPoint, point.getDistributionPoint()))
    {
        fail("mismatch on distributionPoint");
    }
}
项目:irma_future_id    文件:X509CRLObject.java   
static boolean isIndirectCRL(X509CRL crl)
    throws CRLException
{
    try
    {
        byte[] idp = crl.getExtensionValue(Extension.issuingDistributionPoint.getId());
        return idp != null
            && IssuingDistributionPoint.getInstance(ASN1OctetString.getInstance(idp).getOctets()).isIndirectCRL();
    }
    catch (Exception e)
    {
        throw new ExtCRLException(
                "Exception reading IssuingDistributionPoint", e);
    }
}
项目:irma_future_id    文件:RFC3280CertPathUtilities.java   
protected static ReasonsMask processCRLD(
    X509CRL crl,
    DistributionPoint dp)
    throws AnnotatedException
{
    IssuingDistributionPoint idp = null;
    try
    {
        idp = IssuingDistributionPoint.getInstance(CertPathValidatorUtilities.getExtensionValue(crl,
            RFC3280CertPathUtilities.ISSUING_DISTRIBUTION_POINT));
    }
    catch (Exception e)
    {
        throw new AnnotatedException("Issuing distribution point extension could not be decoded.", e);
    }
    // (d) (1)
    if (idp != null && idp.getOnlySomeReasons() != null && dp.getReasons() != null)
    {
        return new ReasonsMask(dp.getReasons()).intersect(new ReasonsMask(idp.getOnlySomeReasons()));
    }
    // (d) (4)
    if ((idp == null || idp.getOnlySomeReasons() == null) && dp.getReasons() == null)
    {
        return ReasonsMask.allReasons;
    }
    // (d) (2) and (d)(3)
    return (dp.getReasons() == null
        ? ReasonsMask.allReasons
        : new ReasonsMask(dp.getReasons())).intersect(idp == null
        ? ReasonsMask.allReasons
        : new ReasonsMask(idp.getOnlySomeReasons()));

}
项目:irma_future_id    文件:X509CRLObject.java   
static boolean isIndirectCRL(X509CRL crl)
    throws CRLException
{
    try
    {
        byte[] idp = crl.getExtensionValue(Extension.issuingDistributionPoint.getId());
        return idp != null
            && IssuingDistributionPoint.getInstance(ASN1OctetString.getInstance(idp).getOctets()).isIndirectCRL();
    }
    catch (Exception e)
    {
        throw new ExtCRLException(
                "Exception reading IssuingDistributionPoint", e);
    }
}
项目:irma_future_id    文件:X509CRLObject.java   
static boolean isIndirectCRL(X509CRL crl)
    throws CRLException
{
    try
    {
        byte[] idp = crl.getExtensionValue(Extension.issuingDistributionPoint.getId());
        return idp != null
            && IssuingDistributionPoint.getInstance(X509ExtensionUtil.fromExtensionValue(idp)).isIndirectCRL();
    }
    catch (Exception e)
    {
        throw new ExtCRLException(
                "Exception reading IssuingDistributionPoint", e);
    }
}
项目:irma_future_id    文件:RFC3280CertPathUtilities.java   
protected static ReasonsMask processCRLD(
    X509CRL crl,
    DistributionPoint dp)
    throws AnnotatedException
{
    IssuingDistributionPoint idp = null;
    try
    {
        idp = IssuingDistributionPoint.getInstance(CertPathValidatorUtilities.getExtensionValue(crl,
            RFC3280CertPathUtilities.ISSUING_DISTRIBUTION_POINT));
    }
    catch (Exception e)
    {
        throw new AnnotatedException("Issuing distribution point extension could not be decoded.", e);
    }
    // (d) (1)
    if (idp != null && idp.getOnlySomeReasons() != null && dp.getReasons() != null)
    {
        return new ReasonsMask(dp.getReasons()).intersect(new ReasonsMask(idp.getOnlySomeReasons()));
    }
    // (d) (4)
    if ((idp == null || idp.getOnlySomeReasons() == null) && dp.getReasons() == null)
    {
        return ReasonsMask.allReasons;
    }
    // (d) (2) and (d)(3)
    return (dp.getReasons() == null
        ? ReasonsMask.allReasons
        : new ReasonsMask(dp.getReasons())).intersect(idp == null
        ? ReasonsMask.allReasons
        : new ReasonsMask(idp.getOnlySomeReasons()));

}
项目:irma_future_id    文件:X509CRLObject.java   
static boolean isIndirectCRL(X509CRL crl)
    throws CRLException
{
    try
    {
        byte[] idp = crl.getExtensionValue(Extension.issuingDistributionPoint.getId());
        return idp != null
            && IssuingDistributionPoint.getInstance(X509ExtensionUtil.fromExtensionValue(idp)).isIndirectCRL();
    }
    catch (Exception e)
    {
        throw new ExtCRLException(
                "Exception reading IssuingDistributionPoint", e);
    }
}
项目:irma_future_id    文件:X509CRLObject.java   
static boolean isIndirectCRL(X509CRL crl)
    throws CRLException
{
    try
    {
        byte[] idp = crl.getExtensionValue(Extension.issuingDistributionPoint.getId());
        return idp != null
            && IssuingDistributionPoint.getInstance(X509ExtensionUtil.fromExtensionValue(idp)).isIndirectCRL();
    }
    catch (Exception e)
    {
        throw new ExtCRLException(
                "Exception reading IssuingDistributionPoint", e);
    }
}
项目:bc-java    文件:X509CRLHolder.java   
private static boolean isIndirectCRL(Extensions extensions)
{
    if (extensions == null)
    {
        return false;
    }

    Extension ext = extensions.getExtension(Extension.issuingDistributionPoint);

    return ext != null && IssuingDistributionPoint.getInstance(ext.getParsedValue()).isIndirectCRL();
}
项目:bc-java    文件:IssuingDistributionPointUnitTest.java   
private void checkValues(IssuingDistributionPoint point, DistributionPointName distributionPoint, boolean onlyContainsUserCerts, boolean onlyContainsCACerts, ReasonFlags onlySomeReasons, boolean indirectCRL, boolean onlyContainsAttributeCerts)
{
    if (point.onlyContainsUserCerts() != onlyContainsUserCerts)
    {
        fail("mismatch on onlyContainsUserCerts");
    }

    if (point.onlyContainsCACerts() != onlyContainsCACerts)
    {
        fail("mismatch on onlyContainsCACerts");
    }

    if (point.isIndirectCRL() != indirectCRL)
    {
        fail("mismatch on indirectCRL");
    }

    if (point.onlyContainsAttributeCerts() != onlyContainsAttributeCerts)
    {
        fail("mismatch on onlyContainsAttributeCerts");
    }

    if (!isEquiv(onlySomeReasons, point.getOnlySomeReasons()))
    {
        fail("mismatch on onlySomeReasons");
    }

    if (!isEquiv(distributionPoint, point.getDistributionPoint()))
    {
        fail("mismatch on distributionPoint");
    }
}
项目:bc-java    文件:X509CRLObject.java   
static boolean isIndirectCRL(X509CRL crl)
    throws CRLException
{
    try
    {
        byte[] idp = crl.getExtensionValue(Extension.issuingDistributionPoint.getId());
        return idp != null
            && IssuingDistributionPoint.getInstance(ASN1OctetString.getInstance(idp).getOctets()).isIndirectCRL();
    }
    catch (Exception e)
    {
        throw new ExtCRLException(
                "Exception reading IssuingDistributionPoint", e);
    }
}
项目:bc-java    文件:RFC3280CertPathUtilities.java   
protected static ReasonsMask processCRLD(
    X509CRL crl,
    DistributionPoint dp)
    throws AnnotatedException
{
    IssuingDistributionPoint idp = null;
    try
    {
        idp = IssuingDistributionPoint.getInstance(CertPathValidatorUtilities.getExtensionValue(crl,
            RFC3280CertPathUtilities.ISSUING_DISTRIBUTION_POINT));
    }
    catch (Exception e)
    {
        throw new AnnotatedException("Issuing distribution point extension could not be decoded.", e);
    }
    // (d) (1)
    if (idp != null && idp.getOnlySomeReasons() != null && dp.getReasons() != null)
    {
        return new ReasonsMask(dp.getReasons()).intersect(new ReasonsMask(idp.getOnlySomeReasons()));
    }
    // (d) (4)
    if ((idp == null || idp.getOnlySomeReasons() == null) && dp.getReasons() == null)
    {
        return ReasonsMask.allReasons;
    }
    // (d) (2) and (d)(3)
    return (dp.getReasons() == null
        ? ReasonsMask.allReasons
        : new ReasonsMask(dp.getReasons())).intersect(idp == null
        ? ReasonsMask.allReasons
        : new ReasonsMask(idp.getOnlySomeReasons()));

}
项目:bc-java    文件:X509CRLObject.java   
static boolean isIndirectCRL(X509CRL crl)
    throws CRLException
{
    try
    {
        byte[] idp = crl.getExtensionValue(Extension.issuingDistributionPoint.getId());
        return idp != null
            && IssuingDistributionPoint.getInstance(ASN1OctetString.getInstance(idp).getOctets()).isIndirectCRL();
    }
    catch (Exception e)
    {
        throw new ExtCRLException(
                "Exception reading IssuingDistributionPoint", e);
    }
}
项目:bc-java    文件:X509CRLObject.java   
static boolean isIndirectCRL(X509CRL crl)
    throws CRLException
{
    try
    {
        byte[] idp = crl.getExtensionValue(Extension.issuingDistributionPoint.getId());
        return idp != null
            && IssuingDistributionPoint.getInstance(X509ExtensionUtil.fromExtensionValue(idp)).isIndirectCRL();
    }
    catch (Exception e)
    {
        throw new ExtCRLException(
                "Exception reading IssuingDistributionPoint", e);
    }
}
项目:bc-java    文件:RFC3280CertPathUtilities.java   
protected static ReasonsMask processCRLD(
    X509CRL crl,
    DistributionPoint dp)
    throws AnnotatedException
{
    IssuingDistributionPoint idp = null;
    try
    {
        idp = IssuingDistributionPoint.getInstance(CertPathValidatorUtilities.getExtensionValue(crl,
            RFC3280CertPathUtilities.ISSUING_DISTRIBUTION_POINT));
    }
    catch (Exception e)
    {
        throw new AnnotatedException("Issuing distribution point extension could not be decoded.", e);
    }
    // (d) (1)
    if (idp != null && idp.getOnlySomeReasons() != null && dp.getReasons() != null)
    {
        return new ReasonsMask(dp.getReasons()).intersect(new ReasonsMask(idp.getOnlySomeReasons()));
    }
    // (d) (4)
    if ((idp == null || idp.getOnlySomeReasons() == null) && dp.getReasons() == null)
    {
        return ReasonsMask.allReasons;
    }
    // (d) (2) and (d)(3)
    return (dp.getReasons() == null
        ? ReasonsMask.allReasons
        : new ReasonsMask(dp.getReasons())).intersect(idp == null
        ? ReasonsMask.allReasons
        : new ReasonsMask(idp.getOnlySomeReasons()));

}
项目:bc-java    文件:X509CRLObject.java   
static boolean isIndirectCRL(X509CRL crl)
    throws CRLException
{
    try
    {
        byte[] idp = crl.getExtensionValue(Extension.issuingDistributionPoint.getId());
        return idp != null
            && IssuingDistributionPoint.getInstance(X509ExtensionUtil.fromExtensionValue(idp)).isIndirectCRL();
    }
    catch (Exception e)
    {
        throw new ExtCRLException(
                "Exception reading IssuingDistributionPoint", e);
    }
}
项目:bc-java    文件:X509CRLObject.java   
static boolean isIndirectCRL(X509CRL crl)
    throws CRLException
{
    try
    {
        byte[] idp = crl.getExtensionValue(Extension.issuingDistributionPoint.getId());
        return idp != null
            && IssuingDistributionPoint.getInstance(X509ExtensionUtil.fromExtensionValue(idp)).isIndirectCRL();
    }
    catch (Exception e)
    {
        throw new ExtCRLException(
                "Exception reading IssuingDistributionPoint", e);
    }
}