@Test
public void validateKey_generated() throws Exception {

  if (TestUtil.isTsan()) {
    // factory.createKey is too slow in Tsan.
    return;
  }
  RsaSsaPssKeyFormat keyFormat =
      RsaSsaPssKeyFormat.newBuilder()
          .setParams(
              RsaSsaPssParams.newBuilder()
                  .setSigHash(HashType.SHA256)
                  .setMgf1Hash(HashType.SHA256)
                  .setSaltLength(32))
          .setModulusSizeInBits(3072)
          .setPublicExponent(ByteString.copyFrom(RSAKeyGenParameterSpec.F4.toByteArray()))
          .build();
  RsaSsaPssPrivateKey privateKey = factory.createKey(keyFormat);
  RsaSsaPssPublicKey publicKey = signManager.getPublicKey(privateKey);
  verifyManager.validateKey(publicKey);
}