本文整理汇总了Java中java.security.cert.X509CRLSelector.setMaxCRLNumber方法的典型用法代码示例。如果您正苦于以下问题:Java X509CRLSelector.setMaxCRLNumber方法的具体用法?Java X509CRLSelector.setMaxCRLNumber怎么用?Java X509CRLSelector.setMaxCRLNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.security.cert.X509CRLSelector
的用法示例。
在下文中一共展示了X509CRLSelector.setMaxCRLNumber方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSetMaxCRLNumberLjava_math_BigInteger
import java.security.cert.X509CRLSelector; //导入方法依赖的package包/类
/**
* setMaxCRLNumber(BigInteger maxCRL) method testing. Tests if CRLs with any
* crl number value match the selector in the case of null crlNumber
* criteria, if specified maxCRL value matches the selector, and if CRL with
* inappropriate crlNumber value does not match the selector.
*/
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "setMaxCRLNumber",
args = {java.math.BigInteger.class}
)
@AndroidOnly("Uses specific class: " +
"org.apache.harmony.security.asn1.ASN1OctetString.")
public void testSetMaxCRLNumberLjava_math_BigInteger() {
X509CRLSelector selector = new X509CRLSelector();
BigInteger maxCRL = new BigInteger("10000");
TestCRL crl = new TestCRL(maxCRL);
selector.setMaxCRLNumber(null);
assertTrue("Any CRL should match in the case of null minCRLNumber.",
selector.match(crl));
selector.setMaxCRLNumber(maxCRL);
assertTrue("The CRL should match the selection criteria.", selector
.match(crl));
selector.setMaxCRLNumber(new BigInteger("9999"));
assertFalse("The CRL should not match the selection criteria.",
selector.match(crl));
}
示例2: testToString
import java.security.cert.X509CRLSelector; //导入方法依赖的package包/类
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "toString",
args = {}
)
public void testToString() {
X509CRLSelector selector = new X509CRLSelector();
X500Principal iss1 = new X500Principal("O=First Org.");
X500Principal iss2 = new X500Principal("O=Second Org.");
BigInteger minCRL = new BigInteger("10000");
BigInteger maxCRL = new BigInteger("10000");
Date date = new Date(200);
selector.addIssuer(iss1);
selector.addIssuer(iss2);
selector.setMinCRLNumber(minCRL);
selector.setMaxCRLNumber(maxCRL);
selector.setDateAndTime(date);
assertNotNull("The result should not be null.", selector.toString());
}
示例3: testGetMaxCRL
import java.security.cert.X509CRLSelector; //导入方法依赖的package包/类
/**
* getMaxCRL() method testing. Tests if the method return null in the case
* of not specified maxCRL criteria, and if the returned value corresponds
* to the specified one.
*/
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "getMaxCRL",
args = {}
)
public void testGetMaxCRL() {
X509CRLSelector selector = new X509CRLSelector();
assertNull("Initially the maxCRL should be null.", selector.getMaxCRL());
BigInteger maxCRL = new BigInteger("10000");
selector.setMaxCRLNumber(maxCRL);
assertTrue("The result should be equal to specified.", maxCRL
.equals(selector.getMaxCRL()));
}
示例4: testClone
import java.security.cert.X509CRLSelector; //导入方法依赖的package包/类
/**
* clone() method testing. Tests if the selector is cloned correctly: the
* crl which matche to the initial selector should match to the clone and
* the change of clone should not cause the change of initial selector.
*/
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "clone",
args = {}
)
@AndroidOnly("Uses specific classes: " +
"org.apache.harmony.security.asn1.ASN1OctetString, " +
"org.apache.harmony.security.asn1.ASN1Integer.")
public void testClone() {
X509CRLSelector selector = new X509CRLSelector();
X500Principal iss1 = new X500Principal("O=First Org.");
X500Principal iss2 = new X500Principal("O=Second Org.");
X500Principal iss3 = new X500Principal("O=Third Org.");
BigInteger minCRL = new BigInteger("10000");
BigInteger maxCRL = new BigInteger("10000");
Date date = new Date(200);
selector.addIssuer(iss1);
selector.addIssuer(iss2);
selector.setMinCRLNumber(minCRL);
selector.setMaxCRLNumber(maxCRL);
selector.setDateAndTime(date);
X509CRLSelector clone = (X509CRLSelector) selector.clone();
TestCRL crl = new TestCRL(iss1);
crl.setCrlNumber(minCRL);
crl.setUpdateDates(new Date(200), new Date(200));
assertTrue("The specified CRL should match the clone selector.",
selector.match(crl));
clone.addIssuer(iss3);
assertFalse("The changes of the clone selector should not cause "
+ "the changes of initial object", selector.getIssuerNames()
.size() == 3);
}