Package org.cdlib.mrt.security
Class SecurityUtil
java.lang.Object
org.cdlib.mrt.security.SecurityUtil
- Author:
- David Loy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringdecodeBase64(String str) static StringdesDecrypt(String text, String tkey) Use DES to decrypt a stringstatic StringdesEncrypt(String text, String tkey) Use DES to encrypt a stringstatic StringencodeBase64(byte[] byteArray) static StringencodeBase64(InputStream inputStream) static StringencodeBase64(String str) static StringDo an MD5 encryption on a string
Note that the encryption does utf-8 conversion of password to byte arraystatic StringDo an MD5 encryption on a string
Note that the encryption does utf-8 conversion of password to byte array
-
Constructor Details
-
SecurityUtil
public SecurityUtil()
-
-
Method Details
-
encrypt
Do an MD5 encryption on a string
Note that the encryption does utf-8 conversion of password to byte array- Parameters:
password- string to encrypt- Returns:
- encrypted String
- Throws:
TException
-
encrypt
Do an MD5 encryption on a string
Note that the encryption does utf-8 conversion of password to byte array- Parameters:
password- string to encryptalgorithm- encryption algorithm type: MD5- Returns:
- encrypted String
- Throws:
TException
-
desEncrypt
Use DES to encrypt a string- Parameters:
text- text to be DES encrypted- Returns:
- encrypted String
- Throws:
TException
-
desDecrypt
Use DES to decrypt a string- Parameters:
text- encrypted string- Returns:
- decrypted String
- Throws:
TException
-
encodeBase64
- Throws:
TException
-
encodeBase64
- Throws:
TException
-
encodeBase64
- Throws:
TException
-
decodeBase64
- Throws:
TException
-