Package com.identity4j.util.crypt.impl
Class UnixBlowfishEncoder
- java.lang.Object
-
- com.identity4j.util.crypt.impl.AbstractEncoder
-
- com.identity4j.util.crypt.impl.UnixBlowfishEncoder
-
- All Implemented Interfaces:
Encoder
public class UnixBlowfishEncoder extends AbstractEncoder
-
-
Constructor Summary
Constructors Constructor Description UnixBlowfishEncoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]encode(byte[] toEncode, byte[] salt, byte[] passphrase, String charset)Encode a stringbooleanisOfType(byte[] encodedBytes, String charset)Determine if this encoder may have been used to create the provided encoded bytes.booleanmatch(byte[] encodedData, byte[] unencodedData, byte[] passphrase, String charset)Check if the provide un-encoded data would match the encoded data if it was encoded.-
Methods inherited from class com.identity4j.util.crypt.impl.AbstractEncoder
decode, getId, randomBytes
-
-
-
-
Field Detail
-
ID
public static final String ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
match
public boolean match(byte[] encodedData, byte[] unencodedData, byte[] passphrase, String charset) throws EncoderExceptionDescription copied from interface:EncoderCheck if the provide un-encoded data would match the encoded data if it was encoded.- Specified by:
matchin interfaceEncoder- Overrides:
matchin classAbstractEncoder- Parameters:
encodedData- encoded dataunencodedData- un-encoded datapassphrase- passphrase if supportedcharset- character set- Returns:
- matches
- Throws:
EncoderException
-
isOfType
public boolean isOfType(byte[] encodedBytes, String charset)Description copied from interface:EncoderDetermine if this encoder may have been used to create the provided encoded bytes. This method should only be used if it is very likely to be the right encoder.- Specified by:
isOfTypein interfaceEncoder- Overrides:
isOfTypein classAbstractEncoder- Parameters:
encodedBytes- encoded bytescharset- character set- Returns:
- this almost certainly was encoded with a similar encoder
-
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
-
-