数据加密 #
配置项说明 #
spring.shardingsphere.datasource.names= # 省略数据源配置,请参考使用手册
spring.shardingsphere.rules.encrypt.tables.<table-name>.query-with-cipher-column= # 该表是否使用加密列进行查询
spring.shardingsphere.rules.encrypt.tables.<table-name>.columns.<column-name>.data-type= # 逻辑列类型
spring.shardingsphere.rules.encrypt.tables.<table-name>.columns.<column-name>.cipher-column= # 加密列名称
spring.shardingsphere.rules.encrypt.tables.<table-name>.columns.<column-name>.cipher-data-type= # 加密列类型
spring.shardingsphere.rules.encrypt.tables.<table-name>.columns.<column-name>.assisted-query-column= # 查询辅助列名称
spring.shardingsphere.rules.encrypt.tables.<table-name>.columns.<column-name>.assisted-query-data-type= # 查询辅助列类型
spring.shardingsphere.rules.encrypt.tables.<table-name>.columns.<column-name>.plain-column= # 原文列名称
spring.shardingsphere.rules.encrypt.tables.<table-name>.columns.<column-name>.plain-data-type= # 原文列类型
spring.shardingsphere.rules.encrypt.tables.<table-name>.columns.<column-name>.encryptor-name= # 加密算法名称
# 加密算法配置
spring.shardingsphere.rules.encrypt.encryptors.<encrypt-algorithm-name>.type= # 加密算法类型
spring.shardingsphere.rules.encrypt.encryptors.<encrypt-algorithm-name>.props.xxx= # 加密算法属性配置
spring.shardingsphere.rules.encrypt.queryWithCipherColumn= # 是否使用加密列进行查询。在有原文列的情况下,可以使用原文列进行查询
示例 #
spring.shardingsphere.rules.encrypt.encryptors.pwd-encryptor.type=AES
spring.shardingsphere.rules.encrypt.encryptors.pwd-encryptor.props.aes-key-value=123456ab
spring.shardingsphere.rules.encrypt.tables.t_user.columns.pwd.cipher-column=pwd_encrypt
spring.shardingsphere.rules.encrypt.tables.t_user.columns.pwd.data-type=INT NOT NULL
spring.shardingsphere.rules.encrypt.tables.t_user.columns.pwd.cipher-data-type=VARCHAR(200) NOT NULL
spring.shardingsphere.rules.encrypt.tables.t_user.columns.pwd.plain-column=pwd_plain
spring.shardingsphere.rules.encrypt.tables.t_user.columns.pwd.plain-data-type=INT NOT NULL
spring.shardingsphere.rules.encrypt.tables.t_user.columns.pwd.assisted-query-column=pwd_assisted
spring.shardingsphere.rules.encrypt.tables.t_user.columns.pwd.assisted-query-data-type= VARCHAR(200) NOT NULL
spring.shardingsphere.rules.encrypt.tables.t_user.columns.pwd.encryptor-name=pwd-encryptor
算法类型的详情,请参见内置加密算法列表。