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


Java JcaDigestCalculatorProviderBuilder.build方法代码示例

本文整理汇总了Java中org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder.build方法的典型用法代码示例。如果您正苦于以下问题:Java JcaDigestCalculatorProviderBuilder.build方法的具体用法?Java JcaDigestCalculatorProviderBuilder.build怎么用?Java JcaDigestCalculatorProviderBuilder.build使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder的用法示例。


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

示例1: generateOCSPRequest

import org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder; //导入方法依赖的package包/类
/**
 * Generates an OCSP request using BouncyCastle.
 * @param issuerCert	certificate of the issues
 * @param serialNumber	serial number
 * @return	an OCSP request
 * @throws OCSPException
 * @throws IOException
 */
private static OCSPReq generateOCSPRequest(X509Certificate issuerCert, BigInteger serialNumber) throws OCSPException, IOException, OperatorException, CertificateEncodingException {
    //Add provider BC
    Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
    
    JcaDigestCalculatorProviderBuilder digestCalculatorProviderBuilder = new JcaDigestCalculatorProviderBuilder();
    DigestCalculatorProvider digestCalculatorProvider = digestCalculatorProviderBuilder.build();
    DigestCalculator digestCalculator = digestCalculatorProvider.get(CertificateID.HASH_SHA1);
    // Generate the id for the certificate we are looking for
    CertificateID id = new CertificateID(digestCalculator, new JcaX509CertificateHolder(issuerCert), serialNumber);
    
    // basic request generation with nonce
    OCSPReqBuilder gen = new OCSPReqBuilder();
    
    gen.addRequest(id);
    
    // create details for nonce extension
    Extension ext = new Extension(OCSPObjectIdentifiers.id_pkix_ocsp_nonce, false, new DEROctetString(new DEROctetString(PdfEncryption.createDocumentId()).getEncoded()));
    gen.setRequestExtensions(new Extensions(new Extension[]{ext}));
    
    return gen.build();
}
 
开发者ID:albfernandez,项目名称:itext2,代码行数:30,代码来源:OcspClientBouncyCastle.java

示例2: createSignerInfoGenerator

import org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder; //导入方法依赖的package包/类
private SignerInfoGenerator createSignerInfoGenerator()
{
	try
	{
		ContentSigner sha1Signer = createContentSigner();

		JcaDigestCalculatorProviderBuilder digestProviderBuilder = new JcaDigestCalculatorProviderBuilder().setProvider("BC");
		JcaSignerInfoGeneratorBuilder signerInfoGeneratorBuilder = new JcaSignerInfoGeneratorBuilder(
				digestProviderBuilder.build());

		return signerInfoGeneratorBuilder.build(sha1Signer, signerCertificate);
	}
	catch (CertificateException | OperatorCreationException e)
	{
		throw YonaException.unexpected(e);
	}
}
 
开发者ID:yonadev,项目名称:yona-server,代码行数:18,代码来源:AppleMobileConfigSigner.java

示例3: getSHA1DigestCalculator

import org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder; //导入方法依赖的package包/类
public static DigestCalculator getSHA1DigestCalculator() throws DSSException {

    try {
      JcaDigestCalculatorProviderBuilder jcaDigestCalculatorProviderBuilder = new JcaDigestCalculatorProviderBuilder();
      jcaDigestCalculatorProviderBuilder.setProvider("BC");
      final DigestCalculatorProvider digestCalculatorProvider = jcaDigestCalculatorProviderBuilder.build();
      final DigestCalculator digestCalculator = digestCalculatorProvider.get(CertificateID.HASH_SHA1);
      return digestCalculator;
    } catch (OperatorCreationException e) {
      throw new DSSException(e);
    }
  }
 
开发者ID:open-eid,项目名称:digidoc4j,代码行数:13,代码来源:AlwaysValidOcspSource.java


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