JCAPI version 1.1.2 has been released today.
This release contains only one bug fix, but it's considered very important.
It turns out that the following methods, after call completion, have reversed the byte order of the passed in signature from big-endian (used in Java) into little-endian (used by MS CAPI):
- Signature.verify(byte[] signature)
- Signature.verify(byte[] signature, int offset, int length)
The error was caused by JCAPI working on an immediate reference to the signature byte array instead of a local copy.
So, if you have persistently saved your signature after calling one of the above methods, then you have to reverse it back into big-endian to make sure that your signature can be successfully verified again.
Here's an example of a Java method that will do the work for you:
static byte[] reverse(byte[] data)
{
int size = data.length;
byte[] reversedData = new byte[size];
for (int i = 0; i < size; i++)
{
reversedData[i] = data[size - i - 1];
}
return reversedData;
}
Our customers can download the commercial (unrestricted) version from the
customers download page. Others are welcome to download the evaluation version from our
public download page.
Sorry for the inconvenience this may have caused you.