CMS digital signature with JavaCard
Posted: Wed Jan 13, 2016 5:25 am
I want to create a detached digital signature in standard format (CMS / CAdES-EPES).
I create hash from document (SHA-256), get hash algorithm ID and give it all into a message. Detached signature is generated for this message(RSA-512) and sent back. I can verify this signature using pure Java code:
Now I need to get CMS(PKCS#7) signature from already signed data. But I don't know how!
Is there any way to get directly a CMS signature from JavaCard?
I create hash from document (SHA-256), get hash algorithm ID and give it all into a message. Detached signature is generated for this message(RSA-512) and sent back. I can verify this signature using pure Java code:
Code: Select all
RSAPublicKey pubK = (RSAPublicKey) cert.getPublicKey();
Signature sig = Signature.getInstance("SHA256withRSA", "BC");
sig.initVerify(pubK);
//load signed file and update sig
...
sig.verify(signedMessage)
Now I need to get CMS(PKCS#7) signature from already signed data. But I don't know how!
Is there any way to get directly a CMS signature from JavaCard?