@Test
public void validateKey_wrongVersion() throws Exception {

  Ed25519PrivateKey validKey = factory.createKey(Ed25519KeyFormat.getDefaultInstance());
  Ed25519PrivateKey invalidKey = Ed25519PrivateKey.newBuilder(validKey).setVersion(1).build();
  try {
    manager.validateKey(invalidKey);
    fail();
  } catch (GeneralSecurityException e) {
    // expected
  }
}