Annotation Interface DecryptResult


@Target({PARAMETER,TYPE}) @Retention(RUNTIME) @Documented public @interface DecryptResult
Decrypt Result Annotation 解密响应注解

Marks a method parameter or class indicating that incoming EncryptedResult should be automatically verified and decrypted before method execution. Framework interceptors should check this annotation and delegate to ResultEncryptionHandler.

标记方法参数或类,表示传入的 EncryptedResult 在方法执行前 应自动验签并解密。框架拦截器应检查此注解并委托给 ResultEncryptionHandler 处理。

Usage Examples | 使用示例:

// Decrypt incoming encrypted request body
@PostMapping("/callback")
public Result<Void> handleCallback(@DecryptResult EncryptedResult encrypted) { ... }

// Decrypt with specific key alias
@PostMapping("/partner/callback")
public Result<Void> handlePartner(@DecryptResult(keyAlias = "partner-key") EncryptedResult encrypted) { ... }

Security | 安全性:

  • Thread-safe: Yes (annotation, immutable) - 线程安全: 是(注解,不可变)
Since:
JDK 25, opencode-base-web V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Encryption algorithm name.
    Key alias for decryption key resolution.
  • Element Details

    • keyAlias

      String keyAlias
      Key alias for decryption key resolution. 解密密钥别名,用于密钥解析。
      Returns:
      the key alias | 密钥别名
      Default:
      ""
    • algorithm

      String algorithm
      Encryption algorithm name. 加密算法名称。
      Returns:
      the algorithm name | 算法名称
      Default:
      ""