ALTER ENCRYPT RULE

说明

ALTER ENCRYPT RULE 语法用于修改加密规则。

语法

语法 铁路图

  1. AlterEncryptRule ::=
  2. 'ALTER' 'ENCRYPT' 'RULE' encryptDefinition (',' encryptDefinition)*
  3. encryptDefinition ::=
  4. ruleName '(' 'COLUMNS' '(' columnDefinition (',' columnDefinition)* ')' ')'
  5. columnDefinition ::=
  6. '(' 'NAME' '=' columnName ',' 'CIPHER' '=' cipherColumnName (',' 'ASSISTED_QUERY' '=' assistedQueryColumnName)? (',' 'LIKE_QUERY' '=' likeQueryColumnName)? ',' encryptAlgorithmDefinition (',' assistedQueryAlgorithmDefinition)? (',' likeQueryAlgorithmDefinition)? ')'
  7. encryptAlgorithmDefinition ::=
  8. 'ENCRYPT_ALGORITHM' '(' 'TYPE' '(' 'NAME' '=' encryptAlgorithmType (',' propertiesDefinition)? ')'
  9. assistedQueryAlgorithmDefinition ::=
  10. 'ASSISTED_QUERY_ALGORITHM' '(' 'TYPE' '(' 'NAME' '=' encryptAlgorithmType (',' propertiesDefinition)? ')'
  11. likeQueryAlgorithmDefinition ::=
  12. 'LIKE_QUERY_ALGORITHM' '(' 'TYPE' '(' 'NAME' '=' encryptAlgorithmType (',' propertiesDefinition)? ')'
  13. propertiesDefinition ::=
  14. 'PROPERTIES' '(' key '=' value (',' key '=' value)* ')'
  15. tableName ::=
  16. identifier
  17. columnName ::=
  18. identifier
  19. cipherColumnName ::=
  20. identifier
  21. assistedQueryColumnName ::=
  22. identifier
  23. likeQueryColumnName ::=
  24. identifier
  25. encryptAlgorithmType ::=
  26. string
  27. key ::=
  28. string
  29. value ::=
  30. literal

补充说明

  • CIPHER 指定密文数据列,ASSISTED_QUERY 指定辅助查询列,LIKE_QUERY 指定模糊查询列;
  • encryptAlgorithmType 指定加密算法类型,请参考 加密算法
  • 重复的 ruleName 将无法被创建。

示例

  • 修改加密规则
  1. ALTER ENCRYPT RULE t_encrypt (
  2. COLUMNS(
  3. (NAME=user_id,CIPHER=user_cipher,ASSISTED_QUERY=assisted_query_user,LIKE_QUERY=like_query_user,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE'))),
  4. (NAME=order_id,CIPHER=order_cipher,ASSISTED_QUERY=assisted_query_order,LIKE_QUERY=like_query_order,ENCRYPT_ALGORITHM(TYPE(NAME='AES',PROPERTIES('aes-key-value'='123456abc'))),ASSISTED_QUERY_ALGORITHM(TYPE(NAME='MD5')),LIKE_QUERY_ALGORITHM(TYPE(NAME='CHAR_DIGEST_LIKE')))
  5. ));

保留字

ALTERENCRYPTRULECOLUMNSNAMECIPHERASSISTED_QUERYLIKE_QUERYENCRYPT_ALGORITHMASSISTED_QUERY_ALGORITHMLIKE_QUERY_ALGORITHMTYPETRUEFALSE

相关链接