Package org.compiere.util
Interface SecureInterface
-
- All Known Implementing Classes:
Secure
public interface SecureInterface
Adempiere Security Interface. To enable your own class, you need to set the property ADEMPIERE_SECURE when starting the client or server. The setting for the default class would be: -DADEMPIERE_SECURE=org.compiere.util.Secure- Version:
- $Id: SecureInterface.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $
- Author:
- Jorg Janke
-
-
Field Summary
Fields Modifier and Type Field Description static String
ADEMPIERE_SECURE
Class Name implementing SecureInterfacestatic String
ADEMPIERE_SECURE_DEFAULT
Default Class Name implementing SecureInterfacestatic String
CLEARVALUE_END
Clear Text Indicatorstatic String
CLEARVALUE_START
Clear Text Indicator xyzstatic String
ENCRYPTEDVALUE_END
Encrypted Text Indiactor ~static String
ENCRYPTEDVALUE_START
Encrypted Text Indiactor ~
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Integer
decrypt(Integer value, int AD_Client_ID)
Decryption.String
decrypt(String value, int AD_Client_ID)
Decryption.BigDecimal
decrypt(BigDecimal value, int AD_Client_ID)
Decryption.Timestamp
decrypt(Timestamp value, int AD_Client_ID)
Decryption.Integer
encrypt(Integer value, int AD_Client_ID)
Encryption.String
encrypt(String value, int AD_Client_ID)
Encryption.BigDecimal
encrypt(BigDecimal value, int AD_Client_ID)
Encryption.Timestamp
encrypt(Timestamp value, int AD_Client_ID)
Encryption.String
getDigest(String value)
Convert String to Digest.String
getSHA512Hash(int iterations, String value, byte[] salt)
Convert String and salt to SHA-512 hash with iterations https://www.owasp.org/index.php/Hashing_Javaboolean
isDigest(String value)
Checks, if value is a valid digest
-
-
-
Field Detail
-
ADEMPIERE_SECURE
static final String ADEMPIERE_SECURE
Class Name implementing SecureInterface- See Also:
- Constant Field Values
-
ADEMPIERE_SECURE_DEFAULT
static final String ADEMPIERE_SECURE_DEFAULT
Default Class Name implementing SecureInterface- See Also:
- Constant Field Values
-
CLEARVALUE_START
static final String CLEARVALUE_START
Clear Text Indicator xyz- See Also:
- Constant Field Values
-
CLEARVALUE_END
static final String CLEARVALUE_END
Clear Text Indicator- See Also:
- Constant Field Values
-
ENCRYPTEDVALUE_START
static final String ENCRYPTEDVALUE_START
Encrypted Text Indiactor ~- See Also:
- Constant Field Values
-
ENCRYPTEDVALUE_END
static final String ENCRYPTEDVALUE_END
Encrypted Text Indiactor ~- See Also:
- Constant Field Values
-
-
Method Detail
-
encrypt
String encrypt(String value, int AD_Client_ID)
Encryption.- Parameters:
value
- clear valueAD_Client_ID
-- Returns:
- encrypted String
-
decrypt
String decrypt(String value, int AD_Client_ID)
Decryption.- Parameters:
value
- encrypted value- Returns:
- decrypted String
-
encrypt
Integer encrypt(Integer value, int AD_Client_ID)
Encryption. The methods must recognize clear text values- Parameters:
value
- clear valueAD_Client_ID
-- Returns:
- encrypted String
-
decrypt
Integer decrypt(Integer value, int AD_Client_ID)
Decryption. The methods must recognize clear text values- Parameters:
value
- encrypted valueAD_Client_ID
-- Returns:
- decrypted String
-
encrypt
BigDecimal encrypt(BigDecimal value, int AD_Client_ID)
Encryption. The methods must recognize clear text values- Parameters:
value
- clear valueAD_Client_ID
-- Returns:
- encrypted String
-
decrypt
BigDecimal decrypt(BigDecimal value, int AD_Client_ID)
Decryption. The methods must recognize clear text values- Parameters:
value
- encrypted valueAD_Client_ID
-- Returns:
- decrypted String
-
encrypt
Timestamp encrypt(Timestamp value, int AD_Client_ID)
Encryption. The methods must recognize clear text values- Parameters:
value
- clear valueAD_Client_ID
-- Returns:
- encrypted String
-
decrypt
Timestamp decrypt(Timestamp value, int AD_Client_ID)
Decryption. The methods must recognize clear text values- Parameters:
value
- encrypted valueAD_Client_ID
-- Returns:
- decrypted String
-
getDigest
String getDigest(String value)
Convert String to Digest. JavaScript version see - http://pajhome.org.uk/crypt/md5/index.html- Parameters:
value
- message- Returns:
- HexString of message (length = 32 characters)
-
isDigest
boolean isDigest(String value)
Checks, if value is a valid digest- Parameters:
value
- digest string- Returns:
- true if valid digest
-
getSHA512Hash
String getSHA512Hash(int iterations, String value, byte[] salt) throws NoSuchAlgorithmException, UnsupportedEncodingException
Convert String and salt to SHA-512 hash with iterations https://www.owasp.org/index.php/Hashing_Java- Parameters:
value
- message- Returns:
- HexString of message (length = 128 characters)
- Throws:
NoSuchAlgorithmException
UnsupportedEncodingException
-
-