Package org.compiere.util
Interface SecureInterface
-
- All Known Implementing Classes:
Secure
public interface SecureInterfaceAdempiere 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 StringADEMPIERE_SECUREClass Name implementing SecureInterfacestatic StringADEMPIERE_SECURE_DEFAULTDefault Class Name implementing SecureInterfacestatic StringCLEARVALUE_ENDClear Text Indicatorstatic StringCLEARVALUE_STARTClear Text Indicator xyzstatic StringENCRYPTEDVALUE_ENDEncrypted Text Indiactor ~static StringENCRYPTEDVALUE_STARTEncrypted Text Indiactor ~
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Integerdecrypt(Integer value, int AD_Client_ID)Decryption.Stringdecrypt(String value, int AD_Client_ID)Decryption.BigDecimaldecrypt(BigDecimal value, int AD_Client_ID)Decryption.Timestampdecrypt(Timestamp value, int AD_Client_ID)Decryption.Integerencrypt(Integer value, int AD_Client_ID)Encryption.Stringencrypt(String value, int AD_Client_ID)Encryption.BigDecimalencrypt(BigDecimal value, int AD_Client_ID)Encryption.Timestampencrypt(Timestamp value, int AD_Client_ID)Encryption.StringgetDigest(String value)Convert String to Digest.StringgetSHA512Hash(int iterations, String value, byte[] salt)Convert String and salt to SHA-512 hash with iterations https://www.owasp.org/index.php/Hashing_JavabooleanisDigest(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:
NoSuchAlgorithmExceptionUnsupportedEncodingException
-
-