Interface VerifiableEvent
- All Known Implementing Classes:
SignedEvent
public interface VerifiableEvent
Verifiable Event Interface
可验证事件接口
Interface for events that can be cryptographically verified.
可以进行加密验证的事件接口。
Features | 主要功能:
- Event signature - 事件签名
- Signature verification - 签名验证
- Tamper detection - 篡改检测
Usage Examples | 使用示例:
if (event instanceof VerifiableEvent ve) {
if (!ve.verify(secretKey)) {
throw new EventSecurityException("Event verification failed");
}
}
Security | 安全性:
- Thread-safe: Yes (stateless) - 线程安全: 是(无状态)
- Since:
- JDK 25, opencode-base-event V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionGet the event signature 获取事件签名booleanVerify the event signature 验证事件签名
-
Method Details
-
getSignature
-
verify
Verify the event signature 验证事件签名- Parameters:
secret- the secret key used for verification | 用于验证的密钥- Returns:
- true if signature is valid | 如果签名有效返回true
-