@Test
public void validateKeyFormat_notValid_throws() throws Exception {

  AesCmacPrfKeyManager manager = new AesCmacPrfKeyManager();
  try {
    manager.keyFactory().validateKeyFormat(makeAesCmacPrfKeyFormat(31));
    fail();
  } catch (GeneralSecurityException e) {
    // expected
  }
  try {
    manager.keyFactory().validateKeyFormat(makeAesCmacPrfKeyFormat(16));
    fail();
  } catch (GeneralSecurityException e) {
    // expected
  }
}