RSAKeyParameters prv,
byte[] slt,
byte[] msg,
byte[] sig)
{
PSSSigner eng = new PSSSigner(new RSAEngine(), new SHA1Digest(), 20);
eng.init(true, new ParametersWithRandom(prv, new FixedRandom(slt)));
try
{
eng.update(msg, 0, msg.length);
byte[] s = eng.generateSignature();
if (!isEqualTo(s, sig))
{
return new SimpleTestResult(false, getName() + ": test " + id + " failed generation");
}
eng.init(false, pub);
eng.update(msg, 0, msg.length);
if (!eng.verifySignature(s))
{
return new SimpleTestResult(false, getName() + ": test " + id + " failed verification");
}
}
catch (Exception e)