org.ofbiz.base.crypto
Class DesCrypt
java.lang.Object
org.ofbiz.base.crypto.DesCrypt
public class DesCrypt
- extends java.lang.Object
Utility class for doing DESded (3DES) Two-Way Encryption
Field Summary |
static java.lang.String |
module
|
Method Summary |
static byte[] |
decrypt(javax.crypto.SecretKey key,
byte[] bytes)
|
static byte[] |
encrypt(javax.crypto.SecretKey key,
byte[] bytes)
|
static javax.crypto.SecretKey |
generateKey()
|
protected static javax.crypto.Cipher |
getCipher(javax.crypto.SecretKey key,
int mode)
|
static javax.crypto.SecretKey |
getDesKey(byte[] rawKey)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
module
public static final java.lang.String module
DesCrypt
public DesCrypt()
generateKey
public static javax.crypto.SecretKey generateKey()
throws java.security.NoSuchAlgorithmException
- Throws:
java.security.NoSuchAlgorithmException
encrypt
public static byte[] encrypt(javax.crypto.SecretKey key,
byte[] bytes)
throws GeneralException
- Throws:
GeneralException
decrypt
public static byte[] decrypt(javax.crypto.SecretKey key,
byte[] bytes)
throws GeneralException
- Throws:
GeneralException
getDesKey
public static javax.crypto.SecretKey getDesKey(byte[] rawKey)
throws GeneralException
- Throws:
GeneralException
getCipher
protected static javax.crypto.Cipher getCipher(javax.crypto.SecretKey key,
int mode)
throws GeneralException
- Throws:
GeneralException