开发者

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();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜