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 TypeMethodDescriptionvoid
void
static String
encryptSHA
(String original) This method encodes a given string using the SHA algorithm.static String
encryptSHA256
(String original) This method encodes a given string using the SHA-256 algorithmstatic 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
-
encryptSHA
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
- Throws:
NoSuchAlgorithmException
- Cripting exception
-
encryptSHA256
This method encodes a given string using the SHA-256 algorithm- Parameters:
original
- String to encode- Returns:
- Encoded string
- Throws:
NoSuchAlgorithmException
- Cripting exception
-
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
-