byte[] data;
//
// ISO 9796-2 - PSS Signing
//
ISO9796d2PSSSigner eng = new ISO9796d2PSSSigner(rsa, new SHA1Digest(), 0, false);
eng.init(true, sigParameters);
try
{
eng.update(msg7[0]);
eng.update(msg7, 1, msg7.length - 1);
data = eng.generateSignature();
}
catch (Exception e)
{
return new SimpleTestResult(false, "ISO9796: failed - exception " + e.toString());
}
eng.init(false, pubParameters);
if (!isSameAs(sig7, 0, data))
{
return new SimpleTestResult(false, "ISO9796: failed ISO9796-2 generation Test 7");
}
eng.update(msg7[0]);
eng.update(msg7, 1, msg7.length - 1);
if (!eng.verifySignature(sig7))
{
return new SimpleTestResult(false, "ISO9796: failed ISO9796-2 verify Test 7");
}
if (!isSameAs(msg7, 0, eng.getRecoveredMessage()))
{
return new SimpleTestResult(false, "ISO9796: failed ISO9796-2 recovery Test 7");
}
return new SimpleTestResult(true, "ISO9796: Okay");