• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java X509CRLSelector类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中java.security.cert.X509CRLSelector的典型用法代码示例。如果您正苦于以下问题:Java X509CRLSelector类的具体用法?Java X509CRLSelector怎么用?Java X509CRLSelector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



X509CRLSelector类属于java.security.cert包,在下文中一共展示了X509CRLSelector类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getInstance

import java.security.cert.X509CRLSelector; //导入依赖的package包/类
/**
 * Returns an instance of this from a <code>X509CRLSelector</code>.
 * 
 * @param selector A <code>X509CRLSelector</code> instance.
 * @return An instance of an <code>X509CRLStoreSelector</code>.
 * @exception IllegalArgumentException if selector is null or creation
 *                fails.
 */
public static X509CRLStoreSelector getInstance(X509CRLSelector selector)
{
    if (selector == null)
    {
        throw new IllegalArgumentException(
            "cannot create from null selector");
    }
    X509CRLStoreSelector cs = new X509CRLStoreSelector();
    cs.setCertificateChecking(selector.getCertificateChecking());
    cs.setDateAndTime(selector.getDateAndTime());
    try
    {
        cs.setIssuerNames(selector.getIssuerNames());
    }
    catch (IOException e)
    {
        // cannot happen
        throw new IllegalArgumentException(e.getMessage());
    }
    cs.setIssuers(selector.getIssuers());
    cs.setMaxCRLNumber(selector.getMaxCRL());
    cs.setMinCRLNumber(selector.getMinCRL());
    return cs;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:33,代码来源:X509CRLStoreSelector.java


示例2: 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


示例3: X509CRLSelector

import java.security.cert.X509CRLSelector; //导入依赖的package包/类
/**
 * @tests java.security.cert.X509CRLSelector#addIssuerName(byte[])
 */
@TestTargetNew(
    level = TestLevel.PARTIAL_COMPLETE,
    notes = "Verifies IOException.",
    method = "addIssuerName",
    args = {byte[].class}
)
public void test_addIssuerName$B_3() throws Exception {
    //Regression for HARMONY-465
    X509CRLSelector obj = new X509CRLSelector();
    try {
        obj.addIssuerName(new byte[] { (byte) 2, (byte) 3, (byte) 4 });
        fail("IOException expected");
    } catch (IOException e) {
        // expected
    }
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:20,代码来源:X509CRLSelectorTest.java


示例4: test_setIssuerNamesLjava_util_Collection01

import java.security.cert.X509CRLSelector; //导入依赖的package包/类
/**
 * @tests setIssuerNames(Collection <?> names)
 */
@TestTargetNew(
    level = TestLevel.PARTIAL,
    notes = "Regression test.",
    method = "setIssuerNames",
    args = {java.util.Collection.class}
)
public void test_setIssuerNamesLjava_util_Collection01() throws IOException {
    // Regression for HARMONY-737
    X509CRLSelector selector = new X509CRLSelector();
    selector.setIssuerNames(new TreeSet<Comparable>() {
        private static final long serialVersionUID = 6009545505321092498L;

        public Iterator<Comparable> iterator() {
            return null;
        }
    });
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:21,代码来源:X509CRLSelectorTest.java


示例5: testX509CRLSelector

import java.security.cert.X509CRLSelector; //导入依赖的package包/类
/**
 * constructor testing.
 *
 */
@TestTargetNew(
    level = TestLevel.COMPLETE,
    notes = "",
    method = "X509CRLSelector",
    args = {}
)
public void testX509CRLSelector() {
    X509CRLSelector selector = new X509CRLSelector();
    assertNull(selector.getDateAndTime());
    assertNull(selector.getCertificateChecking());
    assertNull(selector.getIssuerNames());
    assertNull(selector.getIssuers());
    assertNull(selector.getMaxCRL());
    assertNull(selector.getMinCRL());
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:20,代码来源:X509CRLSelector2Test.java


示例6: testSetMinCRLNumberLjava_math_BigInteger

import java.security.cert.X509CRLSelector; //导入依赖的package包/类
/**
 * setMinCRLNumber(BigInteger minCRL) method testing. Tests if CRLs with any
 * crl number value match the selector in the case of null crlNumber
 * criteria, if specified minCRL value matches the selector, and if CRL with
 * inappropriate crlNumber value does not match the selector.
 */
@TestTargetNew(
    level = TestLevel.COMPLETE,
    notes = "",
    method = "setMinCRLNumber",
    args = {java.math.BigInteger.class}
)
@AndroidOnly("Uses specific class: " +
        "org.apache.harmony.security.asn1.ASN1OctetString.")
public void testSetMinCRLNumberLjava_math_BigInteger() {
    X509CRLSelector selector = new X509CRLSelector();
    BigInteger minCRL = new BigInteger("10000");
    CRL crl = new TestCRL(minCRL);

    selector.setMinCRLNumber(null);
    assertTrue("Any CRL should match in the case of null minCRLNumber.",
            selector.match(crl));
    selector.setMinCRLNumber(minCRL);
    assertTrue("The CRL should match the selection criteria.", selector
            .match(crl));
    selector.setMinCRLNumber(new BigInteger("10001"));
    assertFalse("The CRL should not match the selection criteria.",
            selector.match(crl));
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:30,代码来源:X509CRLSelector2Test.java


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


示例8: 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


示例9: testGetDateAndTime

import java.security.cert.X509CRLSelector; //导入依赖的package包/类
/**
 * getDateAndTime() method testing. Tests if the method return null in the
 * case of not specified dateAndTime criteria, and if the returned value
 * corresponds to the specified one.
 */
@TestTargetNew(
    level = TestLevel.COMPLETE,
    notes = "",
    method = "getDateAndTime",
    args = {}
)
public void testGetDateAndTime() {
    X509CRLSelector selector = new X509CRLSelector();
    assertNull("Initially the dateAndTime criteria should be null.",
            selector.getDateAndTime());
    Date date = new Date(200);
    selector.setDateAndTime(date);
    assertTrue("The result should be equal to specified.", date
            .equals(selector.getDateAndTime()));
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:21,代码来源:X509CRLSelector2Test.java


示例10: testGetCertificateCheckingLjava_X509Certificate

import java.security.cert.X509CRLSelector; //导入依赖的package包/类
/**
 * getCertificateChecking() method testing.
 */
@TestTargetNew(
    level = TestLevel.COMPLETE,
    notes = "",
    method = "getCertificateChecking",
    args = {}
)
public void testGetCertificateCheckingLjava_X509Certificate()
        throws CertificateException {
    X509CRLSelector selector = new X509CRLSelector();

    CertificateFactory certFact = CertificateFactory.getInstance("X509");
    X509Certificate cert = (X509Certificate) certFact
            .generateCertificate(new ByteArrayInputStream(TestUtils
                    .getX509Certificate_v3()));

    selector.setCertificateChecking(cert);
    assertEquals(cert, selector.getCertificateChecking());

    selector.setCertificateChecking(null);
    assertNull(selector.getCertificateChecking());
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:25,代码来源:X509CRLSelector2Test.java


示例11: 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


示例12: getInstance

import java.security.cert.X509CRLSelector; //导入依赖的package包/类
/**
 * Returns an instance of this from a <code>X509CRLSelector</code>.
 * 
 * @param selector A <code>X509CRLSelector</code> instance.
 * @return An instance of an <code>X509CRLStoreSelector</code>.
 * @exception IllegalArgumentException if selector is null or creation
 *                fails.
 */
public static X509CRLStoreSelector getInstance(X509CRLSelector selector)
{
    if (selector == null)
    {
        throw new IllegalArgumentException(
            "cannot create from null selector");
    }
    X509CRLStoreSelector cs = new X509CRLStoreSelector();
    cs.setCertificateChecking(selector.getCertificateChecking());
    cs.setDateAndTime(selector.getDateAndTime());
    try
    {
        cs.setIssuerNames(selector.getIssuerNames());
    }
    catch (IOException e)
    {
        // cannot happen
        throw new IllegalArgumentException(e.getMessage());
    }
    //cs.setIssuers(selector.getIssuers());
    cs.setMaxCRLNumber(selector.getMaxCRL());
    cs.setMinCRLNumber(selector.getMinCRL());
    return cs;
}
 
开发者ID:credentials,项目名称:irma_future_id,代码行数:33,代码来源:X509CRLStoreSelector.java


示例13: findCRLs

import java.security.cert.X509CRLSelector; //导入依赖的package包/类
/**
 * Return a Collection of all CRLs found in the
 * CertStore's that are matching the crlSelect criteriums.
 *
 * @param certSelector a {@link CertSelector CertSelector}
 * object that will be used to select the certificates
 * @param certStores a List containing only {@link CertStore
 * CertStore} objects. These are used to search for
 * CRLs
 *
 * @return a Collection of all found {@link CRL CRL}
 * objects. May be empty but never <code>null</code>.
 */
private Collection findCRLs(
    X509CRLSelector crlSelect,
    List            crlStores)
    throws AnnotatedException
{
    Set crls = new HashSet();
    Iterator iter = crlStores.iterator();

    while (iter.hasNext())
    {
        CertStore   certStore = (CertStore)iter.next();

        try
        {
            crls.addAll(certStore.getCRLs(crlSelect));
        }
        catch (CertStoreException e)
        {
            throw new AnnotatedException("cannot extract crl: " + e, e);
        }
    }

    return crls;
}
 
开发者ID:credentials,项目名称:irma_future_id,代码行数:38,代码来源:PKIXCertPathValidatorSpi.java


示例14: wrap

import java.security.cert.X509CRLSelector; //导入依赖的package包/类
@Override
public X509CRLSelector wrap(X509CRLSelector selector,
                            Collection<X500Principal> certIssuers,
                            String ldapDN)
    throws IOException
{
    throw new UnsupportedOperationException();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:SSLServerCertStoreHelper.java


示例15: wrap

import java.security.cert.X509CRLSelector; //导入依赖的package包/类
@Override
public X509CRLSelector wrap(X509CRLSelector selector,
                            Collection<X500Principal> certIssuers,
                            String ldapDN)
    throws IOException
{
    return new LDAPCertStore.LDAPCRLSelector(selector, certIssuers, ldapDN);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:LDAPCertStoreHelper.java


示例16: getCertificateChecking

import java.security.cert.X509CRLSelector; //导入依赖的package包/类
public X509Certificate getCertificateChecking()
{
    if (baseSelector instanceof X509CRLSelector)
    {
        return ((X509CRLSelector)baseSelector).getCertificateChecking();
    }

    return null;
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:10,代码来源:PKIXCRLStoreSelector.java


示例17: test_addIssuerNameLjava_lang_String02

import java.security.cert.X509CRLSelector; //导入依赖的package包/类
/**
 * @tests java.security.cert.X509CRLSelector#addIssuerName(java.lang.String)
 */
@TestTargetNew(
    level = TestLevel.PARTIAL_COMPLETE,
    notes = "Verifies null as a parameter.",
    method = "addIssuerName",
    args = {java.lang.String.class}
)
public void test_addIssuerNameLjava_lang_String02() throws IOException {
    // Regression for HARMONY-736
    X509CRLSelector selector = new X509CRLSelector();

    // no exception for null
    selector.addIssuerName((String) null);
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:17,代码来源:X509CRLSelectorTest.java


示例18: 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


示例19: testSetIssuersLjava_util_Collection

import java.security.cert.X509CRLSelector; //导入依赖的package包/类
/**
 * setIssuers(Collection <X500Principal> issuers) method testing. Tests if
 * CRLs with any issuers match the selector in the case of null issuerNames
 * criteria, if specified issuers match the selector, and if not specified
 * issuer does not match the selector.
 */
@TestTargetNew(
    level = TestLevel.COMPLETE,
    notes = "",
    method = "setIssuers",
    args = {java.util.Collection.class}
)
public void testSetIssuersLjava_util_Collection() {
    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.");
    TestCRL crl1 = new TestCRL(iss1);
    TestCRL crl2 = new TestCRL(iss2);
    TestCRL crl3 = new TestCRL(iss3);

    selector.setIssuers(null);
    assertTrue("Any CRL issuers should match in the case of null issuers.",
            selector.match(crl1) && selector.match(crl2));

    ArrayList<X500Principal> issuers = new ArrayList<X500Principal>(2);
    issuers.add(iss1);
    issuers.add(iss2);
    selector.setIssuers(issuers);
    assertTrue("The CRL should match the selection criteria.", selector
            .match(crl1)
            && selector.match(crl2));
    assertFalse("The CRL should not match the selection criteria.",
            selector.match(crl3));
    issuers.add(iss3);
    assertFalse("The internal issuer collection is not protected "
            + "against the modifications.", selector.match(crl3));
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:39,代码来源:X509CRLSelector2Test.java


示例20: testSetDateAndTimeLjava_util_Date

import java.security.cert.X509CRLSelector; //导入依赖的package包/类
/**
 * setDateAndTime(Date dateAndTime) method testing. Tests if CRLs with any
 * update dates match the selector in the case of null dateAndTime criteria,
 * if correct dates match and incorrect do not match the selector.
 */
@TestTargetNew(
    level = TestLevel.COMPLETE,
    notes = "",
    method = "setDateAndTime",
    args = {java.util.Date.class}
)
public void testSetDateAndTimeLjava_util_Date() {
    X509CRLSelector selector = new X509CRLSelector();
    TestCRL crl = new TestCRL(new Date(200), new Date(300));
    selector.setDateAndTime(null);
    assertTrue("Any CRL should match in the case of null dateAndTime.",
            selector.match(crl));
    selector.setDateAndTime(new Date(200));
    assertTrue("The CRL should match the selection criteria.", selector
            .match(crl));
    selector.setDateAndTime(new Date(250));
    assertTrue("The CRL should match the selection criteria.", selector
            .match(crl));
    selector.setDateAndTime(new Date(300));
    assertTrue("The CRL should match the selection criteria.", selector
            .match(crl));
    selector.setDateAndTime(new Date(150));
    assertFalse("The CRL should not match the selection criteria.",
            selector.match(crl));
    selector.setDateAndTime(new Date(350));
    assertFalse("The CRL should not match the selection criteria.",
            selector.match(crl));
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:34,代码来源:X509CRLSelector2Test.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Button类代码示例发布时间:2022-05-21
下一篇:
Java AAAARecord类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap