@Test
public void validateKey_wrongVersion_throws() throws Exception {

  HmacPrfKey validKey = factory.createKey(makeHmacPrfKeyFormat(16, HashType.SHA1));
  try {
    manager.validateKey(HmacPrfKey.newBuilder(validKey).setVersion(1).build());
    fail();
  } catch (GeneralSecurityException e) {
    // expected
  }
}