Signature Generation using PKCS#7 Specifications
I want to prepare a digital signature over some content using PKCS#7 specifications(only Signed Data). I am getting signer certificates by accessing SMART card device. I am using BouncyCastle as a provider 开发者_如何学编程in Java and using getEncoded method of CMSSignedData class but the output i am getting is not right and its not working. Can anybody tell me the correct procedure or some sample code to doing the same
prepare a signedData using
crypto.signText("textTosign","ask")
'byteArr' will be ur signedData it will BASE64 encoded do decode it pass that to CMSSignedData
CMSSignedData csd = new CMSSignedData(byteArr);
CertStore cStore = csd.getCertificatesAndCRLs("Collection", "BC");
SignerInformationStore signers = csd.getSignerInfos();
Collection<SignerInformation> lstSigner = signers.getSigners();
精彩评论