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 String
decodeBase64
(String str) static String
desDecrypt
(String text, String tkey) Use DES to decrypt a stringstatic String
desEncrypt
(String text, String tkey) Use DES to encrypt a stringstatic String
encodeBase64
(byte[] byteArray) static String
encodeBase64
(InputStream inputStream) static String
encodeBase64
(String str) static String
Do an MD5 encryption on a string
Note that the encryption does utf-8 conversion of password to byte arraystatic String
Do 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
-