INNER CODE UNIT · Python
MechanismNotEnabledError
open-quantum-safe/liboqs-python · oqs/oqs.py:348
class MechanismNotEnabledError(MechanismNotSupportedError):
"""Exception raised when an algorithm is supported but not enabled by OQS."""
def __init__(self, alg_name: str, enabled: Optional[Iterable[str]] = None) -> None:
"""
Initialize the exception.
:param alg_name: Requested algorithm name.
:param enabled: A list of enabled algorithms to include in the message. Defaults to `None`.
"""
enabled_str = ""
if enabled is not None:
enabled_str = ", ".join(enabled)
enabled_str = f". Enabled algorithms: {enabled_str}"
self.alg_name = alg_name
self.message = f"{alg_name} is supported but not enabled by OQS" + enabled_str