Adempiere 3.5.2a

org.compiere.util
Class Secure

java.lang.Object
  extended by org.compiere.util.Secure
All Implemented Interfaces:
SecureInterface

public class Secure
extends Object
implements SecureInterface

Security Services.

Change log:

Version:
$Id: Secure.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $
Author:
Jorg Janke

Field Summary
 
Fields inherited from interface org.compiere.util.SecureInterface
ADEMPIERE_SECURE, ADEMPIERE_SECURE_DEFAULT, CLEARVALUE_END, CLEARVALUE_START, ENCRYPTEDVALUE_END, ENCRYPTEDVALUE_START
 
Constructor Summary
Secure()
          Adempiere Security
 
Method Summary
static byte[] convertHexString(String hexString)
          Convert Hex String to Byte Array
static String convertToHexString(byte[] bytes)
          Convert Byte Array to Hex String
 BigDecimal decrypt(BigDecimal value)
          Decryption.
 Integer decrypt(Integer value)
          Decryption.
 String decrypt(String value)
          Decryption.
 Timestamp decrypt(Timestamp value)
          Decryption.
 BigDecimal encrypt(BigDecimal value)
          Encryption.
 Integer encrypt(Integer value)
          Encryption.
 String encrypt(String value)
          Encryption.
 Timestamp encrypt(Timestamp value)
          Encryption.
 String getDigest(String value)
          Convert String to Digest.
static int hash(String key)
          Hash checksum number
 boolean isDigest(String value)
          Checks, if value is a valid digest
 String toString()
          String Representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Secure

public Secure()
Adempiere Security

Method Detail

hash

public static int hash(String key)
Hash checksum number

Parameters:
key - key
Returns:
checksum number

convertToHexString

public static String convertToHexString(byte[] bytes)
Convert Byte Array to Hex String

Parameters:
bytes - bytes
Returns:
HexString

convertHexString

public static byte[] convertHexString(String hexString)
Convert Hex String to Byte Array

Parameters:
hexString - hex string
Returns:
byte array

encrypt

public String encrypt(String value)
Encryption.

Specified by:
encrypt in interface SecureInterface
Parameters:
value - clear value
Returns:
encrypted String

decrypt

public String decrypt(String value)
Decryption. The methods must recognize clear text values

Specified by:
decrypt in interface SecureInterface
Parameters:
value - encrypted value
Returns:
decrypted String

encrypt

public Integer encrypt(Integer value)
Encryption. The methods must recognize clear text values

Specified by:
encrypt in interface SecureInterface
Parameters:
value - clear value
Returns:
encrypted String

decrypt

public Integer decrypt(Integer value)
Decryption. The methods must recognize clear text values

Specified by:
decrypt in interface SecureInterface
Parameters:
value - encrypted value
Returns:
decrypted String

encrypt

public BigDecimal encrypt(BigDecimal value)
Encryption. The methods must recognize clear text values

Specified by:
encrypt in interface SecureInterface
Parameters:
value - clear value
Returns:
encrypted String

decrypt

public BigDecimal decrypt(BigDecimal value)
Decryption. The methods must recognize clear text values

Specified by:
decrypt in interface SecureInterface
Parameters:
value - encrypted value
Returns:
decrypted String

encrypt

public Timestamp encrypt(Timestamp value)
Encryption. The methods must recognize clear text values

Specified by:
encrypt in interface SecureInterface
Parameters:
value - clear value
Returns:
encrypted String

decrypt

public Timestamp decrypt(Timestamp value)
Decryption. The methods must recognize clear text values

Specified by:
decrypt in interface SecureInterface
Parameters:
value - encrypted value
Returns:
decrypted String

getDigest

public String getDigest(String value)
Convert String to Digest. JavaScript version see - http://pajhome.org.uk/crypt/md5/index.html

Specified by:
getDigest in interface SecureInterface
Parameters:
value - message
Returns:
HexString of message (length = 32 characters)

isDigest

public boolean isDigest(String value)
Checks, if value is a valid digest

Specified by:
isDigest in interface SecureInterface
Parameters:
value - digest string
Returns:
true if valid digest

toString

public String toString()
String Representation

Overrides:
toString in class Object
Returns:
info

Adempiere 3.5.2a

Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.