// Make sure we generate the same 'random' salt for both normal and raw signers
int saltLen = spec.getSaltLength();
byte[] fixedRandomBytes = new byte[saltLen];
random.nextBytes(fixedRandomBytes);
normalSig.initSign(privKey, new FixedSecureRandom(fixedRandomBytes));
normalSig.update(sampleMessage);
byte[] normalResult = normalSig.sign();
MessageDigest digest = MessageDigest.getInstance(digestOID.getId(), "BC");
byte[] hash = digest.digest(sampleMessage);
Signature rawSig = Signature.getInstance("RAWRSASSA-PSS", "BC");
// Need to init the params explicitly to avoid having a 'raw' variety of every PSS algorithm
rawSig.setParameter(spec);
rawSig.initSign(privKey, new FixedSecureRandom(fixedRandomBytes));
rawSig.update(hash);
byte[] rawResult = rawSig.sign();
if (!Arrays.areEqual(normalResult, rawResult))
{