Class OpenCryptoException

All Implemented Interfaces:
OpenExceptionMeta, Serializable

public class OpenCryptoException extends OpenWebException
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 Details

    • OpenCryptoException

      public OpenCryptoException(String message)
      Create exception with message 使用消息创建异常
      Parameters:
      message - the message | 消息
    • OpenCryptoException

      public OpenCryptoException(String message, Throwable cause)
      Create exception with message and cause 使用消息和原因创建异常
      Parameters:
      message - the message | 消息
      cause - the cause | 原因
  • Method Details

    • encryptionFailed

      public static OpenCryptoException encryptionFailed(String message)
      Create encryption exception 创建加密异常
      Parameters:
      message - the message | 消息
      Returns:
      the exception | 异常
    • decryptionFailed

      public static OpenCryptoException decryptionFailed(String message)
      Create decryption exception 创建解密异常
      Parameters:
      message - the message | 消息
      Returns:
      the exception | 异常
    • invalidKey

      public static OpenCryptoException invalidKey(String message)
      Create key exception 创建密钥异常
      Parameters:
      message - the message | 消息
      Returns:
      the exception | 异常