private static AesCmacPrfParameters parseParameters(ProtoParametersSerialization serialization)
      throws GeneralSecurityException {
    if (!serialization.getKeyTemplate().getTypeUrl().equals(TYPE_URL)) {
      throw new IllegalArgumentException(
          "Wrong type URL in call to AesCmacPrfProtoSerialization.parseParameters: "
              + serialization.getKeyTemplate().getTypeUrl());
    }
    com.google.crypto.tink.proto.AesCmacPrfKeyFormat format;
    try {
      format =
          com.google.crypto.tink.proto.AesCmacPrfKeyFormat.parseFrom(
              serialization.getKeyTemplate().getValue(), ExtensionRegistryLite.getEmptyRegistry());
    } catch (InvalidProtocolBufferException e) {
      throw new GeneralSecurityException("Parsing AesCmacPrfParameters failed: ", e);
    }
    if (format.getVersion() != 0) {
      throw new GeneralSecurityException(
          "Parsing AesCmacPrfParameters failed: unknown Version " + format.getVersion());
    }
    if (serialization.getKeyTemplate().getOutputPrefixType() != OutputPrefixType.RAW) {
      throw new GeneralSecurityException(
          "Parsing AesCmacPrfParameters failed: only RAW output prefix type is accepted");
    }
    return AesCmacPrfParameters.create(format.getKeySize());
  }
Methods to serialize and parse {@link AesCmacPrfKey} objects and {@link AesCmacPrfParameters}
objects.
java_src/src/main/java/com/google/crypto/tink/prf/internal/AesCmacPrfProtoSerialization.java