Class OpenSignatureException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cloud.opencode.base.crypto.exception.OpenSignatureException
- All Implemented Interfaces:
Serializable
Exception for digital signature operations - Runtime exception for signature generation and verification failures
签名相关异常 - 数字签名生成和验证失败时的运行时异常
Features | 主要功能:
- Algorithm context in error messages - 错误消息中包含算法上下文
- Covers signature generation and verification failures - 涵盖签名生成和验证失败
Usage Examples | 使用示例:
throw new OpenSignatureException("Ed25519", "Signature verification failed");
throw new OpenSignatureException("Invalid signature", cause);
Security | 安全性:
- Thread-safe: Yes - 线程安全: 是
- Null-safe: Partial - 空值安全: 部分
- Since:
- JDK 25, opencode-base-crypto V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionOpenSignatureException(String message) Constructs a new OpenSignatureException with the specified message.OpenSignatureException(String algorithm, String message) Constructs a new OpenSignatureException with algorithm and message.OpenSignatureException(String algorithm, String message, Throwable cause) Constructs a new OpenSignatureException with algorithm, message and cause.OpenSignatureException(String message, Throwable cause) Constructs a new OpenSignatureException with the specified message and cause. -
Method Summary
Modifier and TypeMethodDescriptionReturns the signature algorithm associated with this exception.static OpenSignatureExceptioninvalidFormat(String algorithm, String format) Creates an exception for invalid signature format.static OpenSignatureExceptioninvalidSignature(String algorithm) Creates an exception for invalid signatures.static OpenSignatureExceptionsignFailed(String algorithm, Throwable cause) Creates an exception for signature generation failures.static OpenSignatureExceptionverifyFailed(String algorithm, Throwable cause) Creates an exception for signature verification failures.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
OpenSignatureException
Constructs a new OpenSignatureException with the specified message. 使用指定消息构造新的签名异常- Parameters:
message- the detail message
-
OpenSignatureException
-
OpenSignatureException
-
OpenSignatureException
-
-
Method Details
-
algorithm
Returns the signature algorithm associated with this exception. 返回与此异常关联的签名算法- Returns:
- the algorithm, or null if not specified
-
signFailed
Creates an exception for signature generation failures. 创建签名生成失败时的异常- Parameters:
algorithm- the signature algorithmcause- the underlying cause- Returns:
- a new OpenSignatureException
-
verifyFailed
Creates an exception for signature verification failures. 创建签名验证失败时的异常- Parameters:
algorithm- the signature algorithmcause- the underlying cause- Returns:
- a new OpenSignatureException
-
invalidSignature
Creates an exception for invalid signatures. 创建签名无效时的异常- Parameters:
algorithm- the signature algorithm- Returns:
- a new OpenSignatureException
-
invalidFormat
Creates an exception for invalid signature format. 创建签名格式无效时的异常- Parameters:
algorithm- the signature algorithmformat- the invalid format description- Returns:
- a new OpenSignatureException
-