Class PolicyViolationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cloud.opencode.base.crypto.exception.OpenCryptoException
cloud.opencode.base.crypto.policy.PolicyViolationException
- All Implemented Interfaces:
Serializable
Exception thrown when a cryptographic operation violates the configured policy.
当加密操作违反配置的策略时抛出的异常。
Contains the algorithm that violated the policy and a descriptive message explaining why the operation was denied.
包含违反策略的算法以及解释操作被拒绝原因的描述性消息。
Features | 主要功能:
- Carries violated algorithm context - 携带违规算法上下文
- Integrates with CryptoPolicy enforcement - 与 CryptoPolicy 执行集成
Usage Examples | 使用示例:
throw new PolicyViolationException("MD5", "check", "Algorithm MD5 is not allowed by current policy");
Security | 安全性:
- Thread-safe: Yes - 线程安全: 是
- Since:
- JDK 25, opencode-base-crypto V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPolicyViolationException(String algorithm, String operation, String message) Constructs a PolicyViolationException with algorithm, operation, and message. -
Method Summary
Modifier and TypeMethodDescriptionReturns the algorithm that violated the policy.Methods inherited from class OpenCryptoException
algorithm, algorithmNotAvailable, authenticationFailed, dataTooLong, decryptionFailed, encryptionFailed, invalidIv, operation, paddingErrorMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
PolicyViolationException
Constructs a PolicyViolationException with algorithm, operation, and message. 使用算法、操作和消息构造策略违规异常。- Parameters:
algorithm- the algorithm that violated the policy | 违反策略的算法operation- the operation being performed | 正在执行的操作message- the detail message | 详细消息
-
-
Method Details
-
getViolatedAlgorithm
Returns the algorithm that violated the policy. 返回违反策略的算法。- Returns:
- the violated algorithm name | 违规算法名称
-