@Test
public void validateKey_invalidWrongVersion_throws() throws Exception {

  EciesAeadHkdfPrivateKey privateKey = createValidPrivateKey();
  EciesAeadHkdfPublicKey publicKey = privateManager.getPublicKey(privateKey);
  EciesAeadHkdfPublicKey invalidKey = EciesAeadHkdfPublicKey.newBuilder().setVersion(1).build();
  try {
    publicManager.validateKey(invalidKey);
    fail();
  } catch (GeneralSecurityException e) {
    // expected
  }
}