本文整理汇总了Java中java.security.cert.X509CRLSelector.addIssuer方法的典型用法代码示例。如果您正苦于以下问题:Java X509CRLSelector.addIssuer方法的具体用法?Java X509CRLSelector.addIssuer怎么用?Java X509CRLSelector.addIssuer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.security.cert.X509CRLSelector
的用法示例。
在下文中一共展示了X509CRLSelector.addIssuer方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test_addIssuerLjavax_security_auth_x500_X500Principal01
import java.security.cert.X509CRLSelector; //导入方法依赖的package包/类
/**
* @tests java.security.cert.X509CRLSelector#addIssuer(javax.security.auth.x500.X500Principal)
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "",
method = "addIssuer",
args = {javax.security.auth.x500.X500Principal.class}
)
public void test_addIssuerLjavax_security_auth_x500_X500Principal01()
throws Exception {
//Regression for HARMONY-465
X509CRLSelector obj = new X509CRLSelector();
try {
obj.addIssuer((X500Principal) null);
fail("NullPointerException expected");
} catch (NullPointerException e) {
// expected
}
}
示例2: testGetIssuers
import java.security.cert.X509CRLSelector; //导入方法依赖的package包/类
/**
* getIssuers() method testing. Tests if the method return null in the case
* of not specified issuers, if the returned collection corresponds to the
* specified issuers and this collection is unmodifiable.
*/
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "getIssuers",
args = {}
)
public void testGetIssuers() {
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.");
assertNull("The collection should be null.", selector.getIssuers());
selector.addIssuer(iss1);
selector.addIssuer(iss2);
Collection<X500Principal> result = selector.getIssuers();
try {
result.add(iss3);
fail("The returned collection should be unmodifiable.");
} catch (UnsupportedOperationException e) {
}
assertTrue("The collection should contain the specified DN.", result
.contains(iss2));
}
示例3: 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());
}
示例4: testAddIssuerLjavax_security_auth_x500_X500Principal02
import java.security.cert.X509CRLSelector; //导入方法依赖的package包/类
/**
* addIssuer(X500Principal issuer) method testing. Tests if CRLs with
* specified issuers match the selector, and if not specified issuer does
* not match the selector.
*/
@TestTargets({
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "",
method = "addIssuer",
args = {javax.security.auth.x500.X500Principal.class}
),
@TestTargetNew(
level=TestLevel.PARTIAL_COMPLETE,
method="match",
args={java.security.cert.CRL.class}
)
})
public void testAddIssuerLjavax_security_auth_x500_X500Principal02() {
X509CRLSelector selector = new X509CRLSelector();
X500Principal iss1 = new X500Principal("O=First Org.");
X500Principal iss2 = new X500Principal("O=Second Org.");
CRL crl1 = new TestCRL(iss1);
CRL crl2 = new TestCRL(iss2);
selector.addIssuer(iss1);
assertTrue("The CRL should match the selection criteria.", selector
.match(crl1));
assertFalse("The CRL should not match the selection criteria.",
selector.match(crl2));
selector.addIssuer(iss2);
assertTrue("The CRL should match the selection criteria.", selector
.match(crl2));
}
示例5: 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);
}
示例6: test_addIssuerLjavax_security_auth_x500_X500Principal
import java.security.cert.X509CRLSelector; //导入方法依赖的package包/类
/**
* @tests java.security.cert.X509CRLSelector#addIssuer(javax.security.auth.x500.X500Principal)
*/
public void test_addIssuerLjavax_security_auth_x500_X500Principal()
throws Exception {
//Regression for HARMONY-465
X509CRLSelector obj = new X509CRLSelector();
try {
obj.addIssuer((X500Principal) null);
fail("NullPointerException expected");
} catch (NullPointerException e) {
// expected
}
}