Package org.takes.facets.auth.codecs
Interface Codec
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Identity
decode(byte[] bytes)
Decode identity from text (or throwDecodingException
).byte[]
encode(Identity identity)
Encode identity into bytes.
-
-
-
Method Detail
-
encode
byte[] encode(Identity identity) throws IOException
Encode identity into bytes.- Parameters:
identity
- The identity- Returns:
- Text
- Throws:
IOException
- If fails
-
decode
Identity decode(byte[] bytes) throws IOException
Decode identity from text (or throwDecodingException
).This method may throw
DecodingException
, if it's not possible to decode the incoming byte array. This exception will mean that the user can't be authenticated andIdentity.ANONYMOUS
object will be identified.- Parameters:
bytes
- Text- Returns:
- Identity
- Throws:
IOException
- If fails
-
-