private static AesCmacParameters parseParameters(ProtoParametersSerialization serialization)
      throws GeneralSecurityException {
    if (!serialization.getKeyTemplate().getTypeUrl().equals(TYPE_URL)) {
      throw new IllegalArgumentException(
          "Wrong type URL in call to AesCmacProtoSerialization.parseParameters: "
              + serialization.getKeyTemplate().getTypeUrl());
    }
    com.google.crypto.tink.proto.AesCmacKeyFormat format;
    try {
      format =
          com.google.crypto.tink.proto.AesCmacKeyFormat.parseFrom(
              serialization.getKeyTemplate().getValue(), ExtensionRegistryLite.getEmptyRegistry());
    } catch (InvalidProtocolBufferException e) {
      throw new GeneralSecurityException("Parsing AesCmacParameters failed: ", e);
    }

    return AesCmacParameters.builder().setKeySizeBytes(format.getKeySize()).setTagSizeBytes(
        format.getParams().getTagSize()).setVariant(
        toVariant(serialization.getKeyTemplate().getOutputPrefixType())).build();
  }
Methods to serialize and parse {@link AesCmacKey} objects and {@link AesCmacParameters} objects.
java_src/src/main/java/com/google/crypto/tink/mac/internal/AesCmacProtoSerialization.java