namespace StellaOps.Cryptography;
///
/// Exception thrown when a cryptographic operation violates compliance requirements.
///
public sealed class CryptoComplianceException : Exception
{
///
/// The compliance profile that was violated.
///
public string ProfileId { get; }
///
/// The hash purpose that was being processed.
///
public string Purpose { get; }
///
/// The algorithm that was requested.
///
public string RequestedAlgorithm { get; }
///
/// The algorithm that is expected for the profile and purpose.
///
public string ExpectedAlgorithm { get; }
public CryptoComplianceException(
string message,
string profileId,
string purpose,
string requestedAlgorithm,
string expectedAlgorithm)
: base(message)
{
ProfileId = profileId;
Purpose = purpose;
RequestedAlgorithm = requestedAlgorithm;
ExpectedAlgorithm = expectedAlgorithm;
}
public CryptoComplianceException(
string message,
string profileId,
string purpose,
string requestedAlgorithm,
string expectedAlgorithm,
Exception innerException)
: base(message, innerException)
{
ProfileId = profileId;
Purpose = purpose;
RequestedAlgorithm = requestedAlgorithm;
ExpectedAlgorithm = expectedAlgorithm;
}
}