Package com.logicaldoc.util.crypt
Class CryptUtil
java.lang.Object
com.logicaldoc.util.crypt.CryptUtil
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
cryptString
(String original) This method encodes a given string using the SHA-256 algorithmstatic String
cryptStringLegacy
(String original) This method encodes a given string using the SHA algorithm.void
void
static String
getHex
(byte[] raw) static String
Converts a string into a MD4 hash.static String
Converts a string into a MD4 hash suitable for the NTLM v1 authentication
-
Field Details
-
DESEDE_ENCRYPTION_SCHEME
- See Also:
-
DES_ENCRYPTION_SCHEME
- See Also:
-
DEFAULT_ENCRYPTION_KEY
- See Also:
-
-
Constructor Details
-
CryptUtil
- Throws:
CryptUtil.EncryptionException
-
CryptUtil
public CryptUtil(String encryptionScheme, String encryptionKey) throws CryptUtil.EncryptionException - Throws:
CryptUtil.EncryptionException
-
-
Method Details
-
encrypt
- Throws:
CryptUtil.EncryptionException
-
decrypt
- Throws:
CryptUtil.EncryptionException
-
encrypt
- Throws:
CryptUtil.EncryptionException
-
decrypt
- Throws:
CryptUtil.EncryptionException
-
cryptStringLegacy
This method encodes a given string using the SHA algorithm. This method will be dismissed in the future.- Parameters:
original
- String to encode- Returns:
- Encoded string
-
cryptString
This method encodes a given string using the SHA-256 algorithm- Parameters:
original
- String to encode- Returns:
- Encoded string
-
hashMD4
Converts a string into a MD4 hash.- Parameters:
original
- the original string to be encrypted.- Returns:
- the returned hash as bytes.
-
hashNTLM1
Converts a string into a MD4 hash suitable for the NTLM v1 authentication- Parameters:
original
- the original string- Returns:
- the MD4 hash
-
getHex
-