当前位置: 首页>>代码示例>>Java>>正文


Java IssuingDistributionPoint.onlyContainsAttributeCerts方法代码示例

本文整理汇总了Java中org.bouncycastle.asn1.x509.IssuingDistributionPoint.onlyContainsAttributeCerts方法的典型用法代码示例。如果您正苦于以下问题:Java IssuingDistributionPoint.onlyContainsAttributeCerts方法的具体用法?Java IssuingDistributionPoint.onlyContainsAttributeCerts怎么用?Java IssuingDistributionPoint.onlyContainsAttributeCerts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bouncycastle.asn1.x509.IssuingDistributionPoint的用法示例。


在下文中一共展示了IssuingDistributionPoint.onlyContainsAttributeCerts方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkValues

import org.bouncycastle.asn1.x509.IssuingDistributionPoint; //导入方法依赖的package包/类
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");
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:33,代码来源:IssuingDistributionPointUnitTest.java

示例2: checkCriticalExtensions

import org.bouncycastle.asn1.x509.IssuingDistributionPoint; //导入方法依赖的package包/类
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);
		}
	}
}
 
开发者ID:esig,项目名称:dss,代码行数:32,代码来源:AbstractCRLUtils.java

示例3: getIssuingDistributionPointStringValue

import org.bouncycastle.asn1.x509.IssuingDistributionPoint; //导入方法依赖的package包/类
private String getIssuingDistributionPointStringValue(byte[] value) throws IOException {
	// @formatter:off

	/*
	 * IssuingDistributionPoint ::= ASN1Sequence {
	 *     distributionPoint [0] DistributionPointName OPTIONAL,
	 *     onlyContainsUserCerts [1] ASN1Boolean DEFAULT FALSE,
	 *     onlyContainsCACerts [2] ASN1Boolean DEFAULT FALSE,
	 *     onlySomeReasons [3] ReasonFlags OPTIONAL,
	 *     indirectCRL [4] ASN1Boolean DEFAULT FALSE,
	 *     onlyContainsAttributeCerts [5] ASN1Boolean DEFAULT FALSE }
	 */

	// @formatter:on

	/*
	 * Getting any DEFAULTS returns a false ASN1Boolean when no value
	 * present which saves the bother of a null check
	 */

	StringBuilder sb = new StringBuilder();

	IssuingDistributionPoint issuingDistributionPoint = IssuingDistributionPoint.getInstance(value);

	DistributionPointName distributionPointName = issuingDistributionPoint.getDistributionPoint();

	if (distributionPointName != null) { // Optional
		sb.append(getDistributionPointNameString(distributionPointName, ""));
	}

	boolean onlyContainsUserCerts = issuingDistributionPoint.onlyContainsUserCerts();
	sb.append(MessageFormat.format(res.getString("OnlyContainsUserCerts"), onlyContainsUserCerts));
	sb.append(NEWLINE);

	boolean onlyContainsCaCerts = issuingDistributionPoint.onlyContainsCACerts();
	sb.append(MessageFormat.format(res.getString("OnlyContainsCaCerts"), onlyContainsCaCerts));
	sb.append(NEWLINE);

	ReasonFlags onlySomeReasons = issuingDistributionPoint.getOnlySomeReasons();
	if (onlySomeReasons != null) {// Optional
		sb.append(res.getString("OnlySomeReasons"));
		sb.append(NEWLINE);

		String[] reasonFlags = getReasonFlagsStrings(onlySomeReasons);

		for (String reasonFlag : reasonFlags) {
			sb.append(INDENT);
			sb.append(reasonFlag);
			sb.append(NEWLINE);
		}
	}

	boolean indirectCrl = issuingDistributionPoint.isIndirectCRL();
	sb.append(MessageFormat.format(res.getString("IndirectCrl"), indirectCrl));
	sb.append(NEWLINE);

	boolean onlyContainsAttributeCerts = issuingDistributionPoint.onlyContainsAttributeCerts();
	sb.append(MessageFormat.format(res.getString("OnlyContainsAttributeCerts"), onlyContainsAttributeCerts));
	sb.append(NEWLINE);

	return sb.toString();
}
 
开发者ID:kaikramer,项目名称:keystore-explorer,代码行数:63,代码来源:X509Ext.java


注:本文中的org.bouncycastle.asn1.x509.IssuingDistributionPoint.onlyContainsAttributeCerts方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。