开发者

Signature Generation using PKCS#7 Specifications

开发者 https://www.devze.com 2023-01-04 12:27 出处:网络
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 pro

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

精彩评论

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