1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package com.ruoyi.common.annotation;
- import com.ruoyi.common.enums.AlgorithmType;
- import com.ruoyi.common.enums.EncodeType;
- import java.lang.annotation.*;
- /**
- * 字段加密注解
- *
- * @author 老马
- */
- @Documented
- @Inherited
- @Target({ElementType.FIELD})
- @Retention(RetentionPolicy.RUNTIME)
- public @interface EncryptField {
- /**
- * 加密算法
- */
- AlgorithmType algorithm() default AlgorithmType.DEFAULT;
- /**
- * 秘钥。AES、SM4需要
- */
- String password() default "";
- /**
- * 公钥。RSA、SM2需要
- */
- String publicKey() default "";
- /**
- * 公钥。RSA、SM2需要
- */
- String privateKey() default "";
- /**
- * 编码方式。对加密算法为BASE64的不起作用
- */
- EncodeType encode() default EncodeType.DEFAULT;
- }
|