I've been able to use your libraries so far by making use of the samples without much trouble - I've been able to import certificates using this library onto my token that successfully marry with a private key.
However, when I come to sign with the loaded certificate, I receive "CKR_FUNCTION_FAILED" from C_Sign_Init. At the moment I'm calling the following as per your example:
//sign
Mechanism mechanism = new Mechanism(CKM.CKM_SHA1_RSA_PKCS);
byte[] signature = null;
using (Stream inputStream = new FileStream(@"D:\test.txt", FileMode.Open, FileAccess.ReadWrite))
{
// Sign data
signature = session.Sign(mechanism, cert, inputStream);
}
I notice your examples indicate signing using a private key, not a certificate - but I do have the ObjectHandle containing the right certificate being passed to the call to sign. Note I am expecting the resulting signature to be appended to the file/returned in the byte array for me to write to a new file along with the original data.
Am I going about this in the right way? Or is this something that PKCS#11Interop doesn't support?
Thanks,
Pete
--
You received this message because you are subscribed to the Google Groups "Pkcs11Interop" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pkcs11intero...@googlegroups.com.
To post to this group, send email to pkcs11...@googlegroups.com.
Visit this group at http://groups.google.com/group/pkcs11interop.