@Test
public void validateKey_invalidPointFormat_throws() throws Exception {

  EciesAeadHkdfPrivateKey privateKey = createValidPrivateKey();
  EciesAeadHkdfPublicKey publicKey = privateManager.getPublicKey(privateKey);
  EciesAeadHkdfPublicKey invalidKey =
      EciesAeadHkdfPublicKey.newBuilder()
          .setParams(
              createKeyFormat(
                      EllipticCurveType.NIST_P256,
                      HashType.SHA256,
                      EcPointFormat.UNKNOWN_FORMAT,
                      AeadKeyTemplates.AES128_CTR_HMAC_SHA256,
                      "some salt".getBytes("UTF-8"))
                  .getParams()).build();
  try {
    publicManager.validateKey(invalidKey);
    fail();
  } catch (GeneralSecurityException e) {
    // expected
  }
}