Interface SerializationFormat


public interface SerializationFormat
Determines how to serialize and deserialize macaroons into a string format.
  • Field Details

    • V1

      static final SerializationFormat V1
      The original version 1 format of libmacaroons. This format is quite bulky and inefficient so should only be used when compatibility with older libraries such as jmacaroons is required.
    • V2

      static final SerializationFormat V2
      Version 2 format of libmacaroons. This is an efficient packed binary encoding that is significantly smaller than version 1.
  • Method Details

    • serialize

      String serialize(Macaroon macaroon)
      Converts the macaroon to a string.
      Parameters:
      macaroon - the macaroon.
      Returns:
      the serialized string format.
    • deserialize

      Macaroon deserialize(String data)
      Reads a macaroon from a string.
      Parameters:
      data - the input string.
      Returns:
      the deserialized macaroon.
      Throws:
      MacaroonEncodingException - if the input is not a valid macaroon.