byte[] data;
//
// ISO 9796-2 - Signing
//
ISO9796d2Signer eng = new ISO9796d2Signer(rsa, new RIPEMD160Digest(), true);
eng.init(true, privParameters);
try
{
eng.update(msg5[0]);
eng.update(msg5, 1, msg5.length - 1);
data = eng.generateSignature();
}
catch (Exception e)
{
return new SimpleTestResult(false, "ISO9796: failed - exception " + e.toString());
}
eng.init(false, pubParameters);
if (!isSameAs(sig5, 0, data))
{
return new SimpleTestResult(false, "ISO9796: failed ISO9796-2 generation Test 5");
}
eng.update(msg5[0]);
eng.update(msg5, 1, msg5.length - 1);
if (!eng.verifySignature(sig5))
{
return new SimpleTestResult(false, "ISO9796: failed ISO9796-2 verify Test 5");
}
return new SimpleTestResult(true, "ISO9796: Okay");