}
//
// PKCS1 - public encrypt, private decrypt
//
eng = new PKCS1Encoding(eng);
eng.init(true, pubParameters);
try
{
data = eng.processBlock(data, 0, data.length);
}
catch (Exception e)
{
return new SimpleTestResult(false, "RSA: failed - exception " + e.toString());
}
eng.init(false, privParameters);
try
{
data = eng.processBlock(data, 0, data.length);
}
catch (Exception e)
{
return new SimpleTestResult(false, "RSA: failed - exception " + e.toString());
}
if (!input.equals(new String(Hex.encode(data))))
{
return new SimpleTestResult(false, "RSA: failed PKCS1 public/private Test");
}
//
// PKCS1 - private encrypt, public decrypt
//
eng = new PKCS1Encoding(((PKCS1Encoding)eng).getUnderlyingCipher());
eng.init(true, privParameters);
try
{