Hi
I'm trying to create XML signature using two different PKCS#11
implementation directories (CCPkiP11.dll and cryptoCertumPKCS11.dll).
Everything works fine with the second one, but when I'm trying to sign
document using first library I've got CKR_DEVICE_ERROR exception
somwhere in C_Sign method (in dll).
I have encountered that this library allows to sign only 50 bytes of
data. I'm trying to solve this problem for a long time. Could someone
help me what to do? Maybe I should split SignedInfo into some kid of
chunks and sign it on my own?
I also tried to simply sign DigestValue from DigestInfo, but I'm not
sure if this is the right way.
Any ideas? Please help me.
There is a fragment of the code:
XMLSignature sig = new XMLSignature(doc, BaseURI,
XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1);
Transforms transforms = new Transforms(doc);
transforms.addTransform(Transforms.TRANSFORM_ENVELOPED_SIGNATURE);
transforms.addTransform(Transforms.TRANSFORM_C14N_WITH_COMMENTS);
sig.addDocument("", transforms, Constants.ALGO_ID_DIGEST_SHA1);
sig.addKeyInfo(cert.getPublicKey());
sig.sign(privateKey); // <- CKR_DEVICE_ERROR
Jacek