class AesCmacPrfKeyManager extends KeyTypeManager<AesCmacPrfKey> {

  @Override
  public KeyFactory<AesCmacPrfKeyFormat, AesCmacPrfKey> keyFactory() {
    return new KeyFactory<AesCmacPrfKeyFormat, AesCmacPrfKey>(AesCmacPrfKeyFormat.class) {
      @Override
      public void validateKeyFormat(AesCmacPrfKeyFormat format) throws GeneralSecurityException {
        validateSize(format.getKeySize());
      }

      @Override
      public AesCmacPrfKeyFormat parseKeyFormat(ByteString byteString)
          throws InvalidProtocolBufferException {
        return AesCmacPrfKeyFormat.parseFrom(byteString, ExtensionRegistryLite.getEmptyRegistry());
      }

      @Override
      public AesCmacPrfKey createKey(AesCmacPrfKeyFormat format) {
        return AesCmacPrfKey.newBuilder()
            .setVersion(VERSION)
            .setKeyValue(ByteString.copyFrom(Random.randBytes(format.getKeySize())))
            .build();
      }
    };
  }

    AesCmacPrfKeyManager();

}