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


Java X509CRLHolder类代码示例

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


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

示例1: convertHolders

import org.bouncycastle.cert.X509CRLHolder; //导入依赖的package包/类
private CollectionCertStoreParameters convertHolders(JcaX509CertificateConverter certificateConverter, JcaX509CRLConverter crlConverter)
    throws CertificateException, CRLException
{
    List jcaObjs = new ArrayList(certs.size() + crls.size());

    for (Iterator it = certs.iterator(); it.hasNext();)
    {
        jcaObjs.add(certificateConverter.getCertificate((X509CertificateHolder)it.next()));
    }

    for (Iterator it = crls.iterator(); it.hasNext();)
    {
        jcaObjs.add(crlConverter.getCRL((X509CRLHolder)it.next()));
    }

    return new CollectionCertStoreParameters(jcaObjs);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:18,代码来源:JcaCertStoreBuilder.java

示例2: getCRLs

import org.bouncycastle.cert.X509CRLHolder; //导入依赖的package包/类
Store getCRLs(ASN1Set crlSet)
{
    if (crlSet != null)
    {
        List crlList = new ArrayList(crlSet.size());

        for (Enumeration en = crlSet.getObjects(); en.hasMoreElements();)
        {
            ASN1Primitive obj = ((ASN1Encodable)en.nextElement()).toASN1Primitive();

            if (obj instanceof ASN1Sequence)
            {
                crlList.add(new X509CRLHolder(CertificateList.getInstance(obj)));
            }
        }

        return new CollectionStore(crlList);
    }

    return new CollectionStore(new ArrayList());
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:22,代码来源:CMSSignedHelper.java

示例3: getCRLsFromStore

import org.bouncycastle.cert.X509CRLHolder; //导入依赖的package包/类
static List getCRLsFromStore(Store crlStore)
    throws CMSException
{
    List certs = new ArrayList();

    try
    {
        for (Iterator it = crlStore.getMatches(null).iterator(); it.hasNext();)
        {
            X509CRLHolder c = (X509CRLHolder)it.next();

            certs.add(c.toASN1Structure());
        }

        return certs;
    }
    catch (ClassCastException e)
    {
        throw new CMSException("error processing certs", e);
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:22,代码来源:CMSUtils.java

示例4: getCRLs

import org.bouncycastle.cert.X509CRLHolder; //导入依赖的package包/类
/**
 * Return the CRLs stored in the underlying OriginatorInfo object.
 *
 * @return a Store of X509CRLHolder objects.
 */
public Store getCRLs()
{
    ASN1Set crlSet = originatorInfo.getCRLs();

    if (crlSet != null)
    {
        List    crlList = new ArrayList(crlSet.size());

        for (Enumeration en = crlSet.getObjects(); en.hasMoreElements();)
        {
            ASN1Primitive obj = ((ASN1Encodable)en.nextElement()).toASN1Primitive();

            if (obj instanceof ASN1Sequence)
            {
                crlList.add(new X509CRLHolder(CertificateList.getInstance(obj)));
            }
        }

        return new CollectionStore(crlList);
    }

    return new CollectionStore(new ArrayList());
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:29,代码来源:OriginatorInformation.java

示例5: generateCrl

import org.bouncycastle.cert.X509CRLHolder; //导入依赖的package包/类
private X509CRL generateCrl(X509Certificate ca, PrivateKey caPrivateKey, X509Certificate... revoked) throws Exception {
    X509v2CRLBuilder builder = new X509v2CRLBuilder(
        new X500Name(ca.getSubjectDN().getName()),
        new Date()
    );

    for (X509Certificate certificate : revoked) {
        builder.addCRLEntry(certificate.getSerialNumber(), new Date(), CRLReason.privilegeWithdrawn);
    }

    JcaContentSignerBuilder contentSignerBuilder =
        new JcaContentSignerBuilder("SHA256WithRSAEncryption");

    contentSignerBuilder.setProvider("BC");

    X509CRLHolder crlHolder = builder.build(contentSignerBuilder.build(caPrivateKey));

    JcaX509CRLConverter converter = new JcaX509CRLConverter();

    converter.setProvider("BC");

    return converter.getCRL(crlHolder);
}
 
开发者ID:eclipse,项目名称:milo,代码行数:24,代码来源:CertificateValidationUtilTest.java

示例6: generateCRL

import org.bouncycastle.cert.X509CRLHolder; //导入依赖的package包/类
private File generateCRL(X509Certificate cert) throws CRLException, NoSuchAlgorithmException, SignatureException, InvalidKeyException, IOException, OperatorCreationException {
    X500Name issuer = new X500Name("CN=ca");
    Date thisUpdate = new Date();
    X509v2CRLBuilder gen = new X509v2CRLBuilder(issuer, thisUpdate);
    gen.setNextUpdate(new Date(System.currentTimeMillis() + 60000));

    if (cert != null) {
        gen.addCRLEntry(cert.getSerialNumber(), new Date(System.currentTimeMillis() - 1000), CRLReason.keyCompromise);
    }

    ContentSigner sigGen = new JcaContentSignerBuilder("SHA1withRSA").setProvider("BC").build(credential.getPrivateKey());
    X509CRLHolder crl = gen.build(sigGen);

    final File crlFile = File.createTempFile("test", "test");
    crlFile.deleteOnExit();
    FileOutputStream fos = new FileOutputStream(crlFile);
    IOUtils.write(crl.getEncoded(), fos);
    fos.close();
    return crlFile;
}
 
开发者ID:amagdenko,项目名称:oiosaml.java,代码行数:21,代码来源:IntegrationTests.java

示例7: generateCRL

import org.bouncycastle.cert.X509CRLHolder; //导入依赖的package包/类
private File generateCRL(X509Certificate cert) throws CRLException, NoSuchAlgorithmException, SignatureException, InvalidKeyException, IOException, OperatorCreationException {
       X500Name issuer = new X500Name("CN=ca");
       Date thisUpdate = new Date();
       X509v2CRLBuilder gen = new X509v2CRLBuilder(issuer, thisUpdate);
	gen.setNextUpdate(new Date(System.currentTimeMillis() + 60000));

       if (cert != null) {
		gen.addCRLEntry(cert.getSerialNumber(), new Date(System.currentTimeMillis() - 1000), CRLReason.keyCompromise);
	}

       ContentSigner sigGen = new JcaContentSignerBuilder("SHA1withRSA").setProvider("BC").build(cred.getPrivateKey());
	X509CRLHolder crl = gen.build(sigGen);

	final File crlFile = File.createTempFile("test", "test");
	crlFile.deleteOnExit();
	FileOutputStream fos = new FileOutputStream(crlFile);
	IOUtils.write(crl.getEncoded(), fos);
	fos.close();
	return crlFile;
}
 
开发者ID:amagdenko,项目名称:oiosaml.java,代码行数:21,代码来源:CRLCheckerTest.java

示例8: getCrl

import org.bouncycastle.cert.X509CRLHolder; //导入依赖的package包/类
private SignedData getCrl(X509Ca ca, BigInteger serialNumber)
        throws FailInfoException, OperationException {
    if (!control.supportGetCrl()) {
        throw FailInfoException.BAD_REQUEST;
    }

    CertificateList crl = ca.getBcCurrentCrl();
    if (crl == null) {
        throw FailInfoException.BAD_REQUEST;
    }
    CMSSignedDataGenerator cmsSignedDataGen = new CMSSignedDataGenerator();
    cmsSignedDataGen.addCRL(new X509CRLHolder(crl));

    CMSSignedData signedData;
    try {
        signedData = cmsSignedDataGen.generate(new CMSAbsentContent());
    } catch (CMSException ex) {
        LogUtil.error(LOG, ex, "could not generate CMSSignedData");
        throw new OperationException(ErrorCode.SYSTEM_FAILURE, ex);
    }
    return SignedData.getInstance(signedData.toASN1Structure().getContent());
}
 
开发者ID:xipki,项目名称:xipki,代码行数:23,代码来源:ScepImpl.java

示例9: getCRLs

import org.bouncycastle.cert.X509CRLHolder; //导入依赖的package包/类
public Store getCRLs()
    throws CMSException
{
    populateCertCrlSets();

    ASN1Set crlSet = _crlSet;

    if (crlSet != null)
    {
        List    crlList = new ArrayList(crlSet.size());

        for (Enumeration en = crlSet.getObjects(); en.hasMoreElements();)
        {
            ASN1Primitive obj = ((ASN1Encodable)en.nextElement()).toASN1Primitive();

            if (obj instanceof ASN1Sequence)
            {
                crlList.add(new X509CRLHolder(CertificateList.getInstance(obj)));
            }
        }

        return new CollectionStore(crlList);
    }

    return new CollectionStore(new ArrayList());
}
 
开发者ID:credentials,项目名称:irma_future_id,代码行数:27,代码来源:CMSSignedDataParser.java

示例10: getCRLs

import org.bouncycastle.cert.X509CRLHolder; //导入依赖的package包/类
public Store getCRLs()
{
    ASN1Set crlSet = signedData.getCRLs();

    if (crlSet != null)
    {
        List    crlList = new ArrayList(crlSet.size());

        for (Enumeration en = crlSet.getObjects(); en.hasMoreElements();)
        {
            ASN1Primitive obj = ((ASN1Encodable)en.nextElement()).toASN1Primitive();

            if (obj instanceof ASN1Sequence)
            {
                crlList.add(new X509CRLHolder(CertificateList.getInstance(obj)));
            }
        }

        return new CollectionStore(crlList);
    }

    return new CollectionStore(new ArrayList());
}
 
开发者ID:credentials,项目名称:irma_future_id,代码行数:24,代码来源:CMSSignedData.java

示例11: checkCRL

import org.bouncycastle.cert.X509CRLHolder; //导入依赖的package包/类
private void checkCRL(
    int     id,
    byte[]  bytes)
{
    String                  dump = "";

    try
    {
        X509CRLHolder crlHolder = new X509CRLHolder(bytes);

    }
    catch (Exception e)
    {
        fail(dump + System.getProperty("line.separator") + getName() + ": "+ id + " failed - exception " + e.toString());
    }

}
 
开发者ID:credentials,项目名称:irma_future_id,代码行数:18,代码来源:BcCertTest.java


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