BounCycastle轻量级API。到底是什么?
我不太明白,什么是轻量级API以及如何使用它BounCycastle轻量级API。到底是什么?,api,bouncycastle,Api,Bouncycastle,我不太明白,什么是轻量级API以及如何使用它 任何地方都有编译过的jar吗?我只能下载源代码 他们说“从1.47开始,版本2的API在pcpkix包中” e、 g.一段代码 Store certs = new JcaCertStore(certList); AlgorithmIdentifier sigAlgId = new DefaultSignatureAlgorithmIdentifierFinder().find(algorithmName);
Store certs = new JcaCertStore(certList);
AlgorithmIdentifier sigAlgId = new DefaultSignatureAlgorithmIdentifierFinder().find(algorithmName);
AlgorithmIdentifier digAlgId = new DefaultDigestAlgorithmIdentifierFinder().find(sigAlgId);
ContentSigner sigGen = new BcRSAContentSignerBuilder(sigAlgId, digAlgId).build(toRSAPrivateKey(pKey));
CMSSignedDataGenerator gen = new CMSSignedDataGenerator();
X509CertificateHolder certHolder = new X509CertificateHolder(cert.getEncoded());
gen.addSignerInfoGenerator(new SignerInfoGeneratorBuilder(new BcDigestCalculatorProvider()).setDirectSignature(true).build(sigGen, certHolder));
gen.addCertificates(certs);
.....
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
DEROutputStream dOut = new DEROutputStream(bOut);
dOut.writeObject(s.toASN1Structure().toASN1Primitive());
dOut.close();
Store、AlgorithmIdentifier、DEROutputStream位于bcprovider(或lcrypto)jar中。
BcDigestCalculatorProvider、BcRSAContentSignerBuilder位于pcpix jar中
算法识别器、存储等不是轻量级API的一部分
3.为了使用轻量级API,我必须使用几个jar还是有多个一体式jar