public final class CcAES extends Object implements Codec
The class is immutable and thread-safe.
Modifier and Type | Method and Description |
---|---|
Identity |
decode(byte[] bytes)
Decode identity from text (or throw
DecodingException ). |
byte[] |
encode(Identity identity)
Encode identity into bytes.
|
public CcAES(Codec codec, byte[] key) throws IOException
codec
- Original codeckey
- The encryption keyIOException
- errors on creating internal componentspublic byte[] encode(Identity identity) throws IOException
Codec
encode
in interface Codec
identity
- The identityIOException
- If failspublic Identity decode(byte[] bytes) throws IOException
Codec
DecodingException
).
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 and Identity.ANONYMOUS
object will be identified.
decode
in interface Codec
bytes
- TextIOException
- If failsCopyright © 2015 Take. All rights reserved.