public static final void validateRsaSsaPss(
      RSAPrivateCrtKey privateKey,
      RSAPublicKey publicKey,
      Enums.HashType sigHash,
      Enums.HashType mgf1Hash,
      int saltLength)
      throws GeneralSecurityException {

    RsaSsaPssSignJce rsaSigner = new RsaSsaPssSignJce(privateKey, sigHash, mgf1Hash, saltLength);
    RsaSsaPssVerifyJce rsaVerifier =
        new RsaSsaPssVerifyJce(publicKey, sigHash, mgf1Hash, saltLength);
    try {
      rsaVerifier.verify(rsaSigner.sign(TEST_MESSAGE.toByteArray()), TEST_MESSAGE.toByteArray());
    } catch (GeneralSecurityException e) {
      throw new GeneralSecurityException(
          "RSA PSS signing with private key followed by verifying with public key failed."
              + " The key may be corrupted.",
          e);
    }
  }
Self Key tests validation helper methods.
java_src/src/main/java/com/google/crypto/tink/subtle/SelfKeyTestValidators.java