Package com.identity4j.util.crypt.impl
Class Base64Encoder
- java.lang.Object
-
- com.identity4j.util.crypt.impl.AbstractEncoder
-
- com.identity4j.util.crypt.impl.Base64Encoder
-
- All Implemented Interfaces:
Encoder
public class Base64Encoder extends AbstractEncoder
-
-
Constructor Summary
Constructors Constructor Description Base64Encoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]decode(byte[] toDecode, byte[] salt, byte[] passphrase, String charset)Decode bytes (if supported) to text.byte[]encode(byte[] toEncode, byte[] salt, byte[] passphrase, String charset)Encode a string-
Methods inherited from class com.identity4j.util.crypt.impl.AbstractEncoder
getId, isOfType, match, randomBytes
-
-
-
-
Field Detail
-
ID
public static final String ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
encode
public byte[] encode(byte[] toEncode, byte[] salt, byte[] passphrase, String charset) throws EncoderExceptionDescription copied from interface:EncoderEncode a string- Parameters:
toEncode- data to encodesalt- salt if supportedpassphrase- passphrase if supportedcharset- character set- Returns:
- encoded bytes
- Throws:
EncoderException- if encoding fails
-
decode
public byte[] decode(byte[] toDecode, byte[] salt, byte[] passphrase, String charset) throws EncoderExceptionDescription copied from interface:EncoderDecode bytes (if supported) to text.- Specified by:
decodein interfaceEncoder- Overrides:
decodein classAbstractEncoder- Parameters:
toDecode- bytes to decodesalt- TODOpassphrase- passphrase if supportedcharset- character set- Returns:
- decoded text
- Throws:
EncoderException- if encoding fails
-
-