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


Java X509CRLSelector.addIssuer方法代码示例

本文整理汇总了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
    }
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:21,代码来源:X509CRLSelectorTest.java

示例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));
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:29,代码来源:X509CRLSelector2Test.java

示例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());
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:23,代码来源:X509CRLSelector2Test.java

示例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));
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:35,代码来源:X509CRLSelector2Test.java

示例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);
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:42,代码来源:X509CRLSelector2Test.java

示例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
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:15,代码来源:X509CRLSelectorTest.java


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