Package org.forgerock.macaroons
Interface SerializationFormat
-
public interface SerializationFormatDetermines how to serialize and deserialize macaroons into a string format.
-
-
Field Summary
Fields Modifier and Type Field Description static SerializationFormatV1The original version 1 format of libmacaroons.static SerializationFormatV2Version 2 format of libmacaroons.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Macaroondeserialize(String data)Reads a macaroon from a string.Stringserialize(Macaroon macaroon)Converts the macaroon to a string.
-
-
-
Field Detail
-
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 Detail
-
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.
-
-