Package org.apache.ofbiz.base.crypto
Class DesCrypt
- java.lang.Object
-
- org.apache.ofbiz.base.crypto.DesCrypt
-
public class DesCrypt extends java.lang.Object
Utility class for doing DESded (3DES) Two-Way Encryption
-
-
Constructor Summary
Constructors Constructor Description DesCrypt()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
decrypt(java.security.Key key, byte[] bytes)
static byte[]
encrypt(java.security.Key key, byte[] bytes)
static java.security.Key
generateKey()
protected static javax.crypto.Cipher
getCipher(java.security.Key key, int mode, javax.crypto.spec.IvParameterSpec iv)
static java.security.Key
getDesKey(byte[] rawKey)
-
-
-
Method Detail
-
generateKey
public static java.security.Key generateKey() throws java.security.NoSuchAlgorithmException
- Throws:
java.security.NoSuchAlgorithmException
-
encrypt
public static byte[] encrypt(java.security.Key key, byte[] bytes) throws GeneralException
- Throws:
GeneralException
-
decrypt
public static byte[] decrypt(java.security.Key key, byte[] bytes) throws GeneralException
- Throws:
GeneralException
-
getDesKey
public static java.security.Key getDesKey(byte[] rawKey) throws GeneralException
- Throws:
GeneralException
-
getCipher
protected static javax.crypto.Cipher getCipher(java.security.Key key, int mode, javax.crypto.spec.IvParameterSpec iv) throws GeneralException
- Throws:
GeneralException
-
-