@Test
public void validateKey_generated() throws Exception {

  if (TestUtil.isTsan()) {
    // factory.createKey is too slow in Tsan.
    return;
  }
  RsaSsaPkcs1KeyFormat keyFormat =
      RsaSsaPkcs1KeyFormat.newBuilder()
          .setParams(RsaSsaPkcs1Params.newBuilder().setHashType(HashType.SHA256))
          .setModulusSizeInBits(3072)
          .setPublicExponent(ByteString.copyFrom(RSAKeyGenParameterSpec.F4.toByteArray()))
          .build();
  RsaSsaPkcs1PrivateKey privateKey = factory.createKey(keyFormat);
  RsaSsaPkcs1PublicKey publicKey = signManager.getPublicKey(privateKey);
  verifyManager.validateKey(publicKey);
}