Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Table of Contents |
---|
Code Block | ||
---|---|---|
| ||
import org.joget.commons.util.SecurityUtil;
String value = "this is a test string";
String encryptedValue = SecurityUtil.encrypt(value); |
public final static String ENVELOPE = "%%%%";
A string used to prepend and append to a encrypted data for differential purpose.
public static java.lang.String computeHash(java.lang.String rawContent, java.lang.String randomSalt)
Computes the hash of a raw content if data encryption implementation is exist
public static java.lang.String decrypt(java.lang.String protectedContent)
Decrypt protected content if data encryption implementation is exist
public static java.lang.String encrypt(java.lang.String rawContent)
Encrypt raw content if data encryption implementation is exist
public static java.lang.String generateNonce(java.lang.String[] attributes, int lifepanHour)
Generate a nonce value based on attributes if Nonce Generator implementation is exist
public static java.lang.String generateRandomSalt()
Generate a random salt value if data encryption implementation is exist
public static org.springframework.context.ApplicationContext getApplicationContext()
Utility method to retrieve the ApplicationContext of the system
public static java.lang.String getCsrfTokenName()
Returns the name of the CRSF token
public static java.lang.String getCsrfTokenValue(javax.servlet.http.HttpServletRequest request)
Returns the value of the CRSF token in the request
public static org.joget.commons.util.DataEncryption getDataEncryption()
Gets the data encryption implementation
public static java.lang.String getDomainName(java.lang.String url)
Gets the domain name from a given URL
public static org.joget.commons.util.NonceGenerator getNonceGenerator()
Gets the nonce generator implementation
public static boolean hasSecurityEnvelope(java.lang.String content)
Check the content is a wrapped in a security envelop if data encryption implementation is exist
public static boolean isAllowedDomain(java.lang.String domain, java.util.List<java.lang.String> whitelist)
Verify the domain name against a whitelist
public void setDataEncryption(org.joget.commons.util.DataEncryption deImpl)
Sets a data encryption implementation
public void setNonceGenerator(org.joget.commons.util.NonceGenerator ngImpl)
Sets a nonce generator implementation
public static java.lang.Boolean verifyHash(java.lang.String hash, java.lang.String randomSalt, java.lang.String rawContent)
Verify the hash is belong to the raw content if data encryption implementation is exist
public static boolean verifyNonce(java.lang.String nonce, java.lang.String[] attributes)
Verify the nonce is a valid nonce against the attributes if Nonce Generator implementation is exist