Package org.forgerock.macaroons
Interface SerializationFormat
public interface SerializationFormat
Determines how to serialize and deserialize macaroons into a string format.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final SerializationFormat
The original version 1 format of libmacaroons.static final SerializationFormat
Version 2 format of libmacaroons. -
Method Summary
-
Field Details
-
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
Version 2 format of libmacaroons. This is an efficient packed binary encoding that is significantly smaller than version 1.
-
-
Method Details
-
serialize
Converts the macaroon to a string.- Parameters:
macaroon
- the macaroon.- Returns:
- the serialized string format.
-
deserialize
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.
-