org.ofbiz.base.crypto
Class DesCrypt

java.lang.Object
  extended by 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
           
 
Constructor Summary
DesCrypt()
           
 
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
 

Field Detail

module

public static final java.lang.String module
Constructor Detail

DesCrypt

public DesCrypt()
Method Detail

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