本文整理汇总了Java中org.bouncycastle.asn1.x509.IssuingDistributionPoint.onlyContainsUserCerts方法的典型用法代码示例。如果您正苦于以下问题:Java IssuingDistributionPoint.onlyContainsUserCerts方法的具体用法?Java IssuingDistributionPoint.onlyContainsUserCerts怎么用?Java IssuingDistributionPoint.onlyContainsUserCerts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.asn1.x509.IssuingDistributionPoint
的用法示例。
在下文中一共展示了IssuingDistributionPoint.onlyContainsUserCerts方法的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");
}
}
示例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);
}
}
}
示例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();
}