Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Description

Thai

ลักษณะ

  • org.joget.commons.util.SecurityUtil
  • Under wflow-commons module
  • Utility methods used by security feature

Code Sample

Thai

ตัวอย่างโค้ด

Code Block
languagejava
import org.joget.commons.util.SecurityUtil;


String value = "this is a test string";
String encryptedValue = SecurityUtil.encrypt(value); 

Fields

Thai

ฟิลด์

ENVELOPE
public final static String ENVELOPE = "%%%%";
English
A string used to prepend and append to a encrypted data for differential purpose.
Thai

สตริงที่ใช้เพื่อผนวกและผนวกเข้ากับข้อมูลที่เข้ารหัสเพื่อวัตถุประสงค์ที่แตกต่างกัน

Methods

Thai

กระบวนการ

computeHash
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

Thai

คำนวณแฮชของเนื้อหาดิบหากมีการใช้การเข้ารหัสข้อมูลอยู่

decrypt
public static java.lang.String decrypt(java.lang.String protectedContent)

Decrypt protected content if data encryption implementation is exist

Thai

ถอดรหัสเนื้อหาที่ได้รับการป้องกันหากมีการใช้การเข้ารหัสข้อมูลอยู่

encrypt
public static java.lang.String encrypt(java.lang.String rawContent)

Encrypt raw content if data encryption implementation is exist

Thai

เข้ารหัสเนื้อหาดิบหากมีการใช้การเข้ารหัสข้อมูลอยู่

generateNonce
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

Thai

สร้างค่า nonce ตามแอ็ตทริบิวต์หากมีการใช้งานตัวสร้าง Nonce

generateRandomSalt
public static java.lang.String generateRandomSalt()

Generate a random salt value if data encryption implementation is exist

Thai

สร้างค่าเกลือแบบสุ่มหากมีการใช้การเข้ารหัสข้อมูลอยู่

getApplicationContext
public static org.springframework.context.ApplicationContext getApplicationContext()

Utility method to retrieve the ApplicationContext of the system

Thai

วิธีการ Utility เพื่อดึง ApplicationContext ของระบบ

getCsrfTokenName
public static java.lang.String getCsrfTokenName()

Returns the name of the CRSF token

Thai

ส่งคืนชื่อของโทเค็น CRSF

getCsrfTokenValue
public static java.lang.String getCsrfTokenValue(javax.servlet.http.HttpServletRequest request)

Returns the value of the CRSF token in the request

Thai

ส่งคืนค่าของโทเค็น CRSF ในคำขอ

getDataEncryption
public static org.joget.commons.util.DataEncryption getDataEncryption()

Gets the data encryption implementation

Thai

รับการประยุกต์ใช้การเข้ารหัสข้อมูล

getDomainName
public static java.lang.String getDomainName(java.lang.String url)

Gets the domain name from a given URL

Thai

รับชื่อโดเมนจาก URL ที่กำหนด

getNonceGenerator
public static org.joget.commons.util.NonceGenerator getNonceGenerator()

Gets the nonce generator implementation

Thai

รับการประยุกต์ใช้ตัวสร้าง nonce

hasSecurityEnvelope
public static boolean hasSecurityEnvelope(java.lang.String content)

Check the content is a wrapped in a security envelop if data encryption implementation is exist

Thai

ตรวจสอบเนื้อหาว่าอยู่ในห่อหุ้มความปลอดภัยหากมีการใช้การเข้ารหัสข้อมูลอยู่

isAllowedDomain
public static boolean isAllowedDomain(java.lang.String domain, java.util.List<java.lang.String> whitelist)

Verify the domain name against a whitelist

Thai

ตรวจสอบชื่อโดเมนกับบัญชีขาว

setDataEncryption
public void setDataEncryption(org.joget.commons.util.DataEncryption deImpl)

Sets a data encryption implementation

Thai

ตั้งค่าการใช้การเข้ารหัสข้อมูล

setNonceGenerator
public void setNonceGenerator(org.joget.commons.util.NonceGenerator ngImpl)

Sets a nonce generator implementation

Thai

ตั้งค่าการประยุกต์ใช้ตัวสร้าง nonce

verifyHash
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

Thai

ตรวจสอบว่าแฮชเป็นของเนื้อหาดิบหากมีการใช้การเข้ารหัสข้อมูลอยู่

verifyNonce
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

Thai

ตรวจสอบว่า nonce เป็น nonce ที่ถูกต้องกับแอตทริบิวต์ถ้ามีการใช้งานตัวสร้าง Nonce