@Test
public void validateKey_wrongLength64_throws() throws Exception {

  Ed25519PrivateKey validKey = factory.createKey(Ed25519KeyFormat.getDefaultInstance());
  Ed25519PrivateKey invalidKey =
      Ed25519PrivateKey.newBuilder(validKey)
          .setKeyValue(ByteString.copyFrom(Random.randBytes(64)))
          .build();
  try {
    manager.validateKey(invalidKey);
    fail();
  } catch (GeneralSecurityException e) {
    // expected
  }
}