Open hdygxsj opened 1 month ago
close #391 . Integrating cryptographic algorithm APIs for password encryption throughout the project, as well as providing implementations of national cryptographic standards (Chinese domestic algorithms).
Configuration.
paimon: web: cryptography: digester: algorithm: sm3 symmetric: algorithm: sm4 properties: secret-key: ${SECRET_KEY}
Use Api.
@Autowire private SymmetricCryptoService symmetricCryptoService; @Autowire private DigesterService digesterService;
org.apache.paimon.web.cryptography.Sm3DigesterServiceTest. org.apache.paimon.web.cryptography.Sm4SymmetricCryptoServiceTest.
/** DigesterService. */ public interface DigesterService { /** Digest. */ String digestHex(String data); /** Digest with salt. */ String digestHex(String data, String salt); }
/** SymmetricCryptoService. */ public interface SymmetricCryptoService { /** Encrypt. */ String encrypt(String data); /** Decrypt. */ String decrypt(String data); }
Purpose
close #391 . Integrating cryptographic algorithm APIs for password encryption throughout the project, as well as providing implementations of national cryptographic standards (Chinese domestic algorithms).
How to use
Configuration.
Use Api.
Tests
org.apache.paimon.web.cryptography.Sm3DigesterServiceTest. org.apache.paimon.web.cryptography.Sm4SymmetricCryptoServiceTest.
API and Format
Documentation