Class OpenCryptoException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cloud.opencode.base.core.exception.OpenException
cloud.opencode.base.web.exception.OpenWebException
cloud.opencode.base.web.crypto.OpenCryptoException
- All Implemented Interfaces:
OpenExceptionMeta, Serializable
Open Crypto Exception
加密异常
Exception for encryption/decryption errors.
加密/解密错误的异常。
Features | 主要功能:
- Specific exception for encryption/decryption errors - 加密/解密错误的特定异常
- Factory methods for common error types - 常见错误类型的工厂方法
Usage Examples | 使用示例:
throw OpenCryptoException.encryptionFailed("Invalid padding");
throw OpenCryptoException.decryptionFailed("Corrupt data");
throw OpenCryptoException.invalidKey("Key too short");
Security | 安全性:
- Thread-safe: Yes (immutable after construction) - 是(构造后不可变)
- Null-safe: No (message should not be null) - 否(消息不应为null)
- Since:
- JDK 25, opencode-base-web V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionOpenCryptoException(String message) Create exception with message 使用消息创建异常OpenCryptoException(String message, Throwable cause) Create exception with message and cause 使用消息和原因创建异常 -
Method Summary
Modifier and TypeMethodDescriptionstatic OpenCryptoExceptiondecryptionFailed(String message) Create decryption exception 创建解密异常static OpenCryptoExceptionencryptionFailed(String message) Create encryption exception 创建加密异常static OpenCryptoExceptioninvalidKey(String message) Create key exception 创建密钥异常Methods inherited from class OpenWebException
badRequest, forbidden, getCode, getHttpStatus, getMessage, internalError, internalError, notFound, unauthorizedMethods inherited from class OpenException
getComponent, getErrorCode, getRawMessageMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface OpenExceptionMeta
getMetaPrefix
-
Constructor Details
-
OpenCryptoException
Create exception with message 使用消息创建异常- Parameters:
message- the message | 消息
-
OpenCryptoException
-
-
Method Details
-
encryptionFailed
Create encryption exception 创建加密异常- Parameters:
message- the message | 消息- Returns:
- the exception | 异常
-
decryptionFailed
Create decryption exception 创建解密异常- Parameters:
message- the message | 消息- Returns:
- the exception | 异常
-
invalidKey
Create key exception 创建密钥异常- Parameters:
message- the message | 消息- Returns:
- the exception | 异常
-