I don't quite understand, what exactly is Lightweight API and how to use it.
- Is there a compiled jar anywhere? I can download source code only.
- They say "From 1.47, the version 2 APIs are in the pcpkix packages"
e.g. a piece of code
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 are in bcprovider (or lcrypto) jar. BcDigestCalculatorProvider, BcRSAContentSignerBuilder are in pcpix jar.
AlgorithmIdentifier, Store etc are not a part of lightweight API?
3.In order to use Lightweight API do I have to use several jars or is there all-in-1 jar ?