byte[] data;
//
// ISO 9796-1 - public encrypt, private decrypt
//
ISO9796d1Encoding eng = new ISO9796d1Encoding(rsa);
eng.init(true, privParameters);
eng.setPadBits(4);
try
{
data = eng.processBlock(msg1, 0, msg1.length);
}
catch (Exception e)
{
return new SimpleTestResult(false, "ISO9796: failed - exception " + e.toString());
}
eng.init(false, pubParameters);
if (!isSameAs(sig1, 0, data))
{
return new SimpleTestResult(false, "ISO9796: failed ISO9796-1 generation Test 1");
}
try
{
data = eng.processBlock(data, 0, data.length);
}
catch (Exception e)
{
return new SimpleTestResult(false, "ISO9796: failed - exception " + e.toString());
}