Files
git.stella-ops.org/src/__Libraries/StellaOps.Cryptography/CryptoComplianceException.cs
master cc69d332e3
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
Add unit tests for RabbitMq and Udp transport servers and clients
- Implemented comprehensive unit tests for RabbitMqTransportServer, covering constructor, disposal, connection management, event handlers, and exception handling.
- Added configuration tests for RabbitMqTransportServer to validate SSL, durable queues, auto-recovery, and custom virtual host options.
- Created unit tests for UdpFrameProtocol, including frame parsing and serialization, header size validation, and round-trip data preservation.
- Developed tests for UdpTransportClient, focusing on connection handling, event subscriptions, and exception scenarios.
- Established tests for UdpTransportServer, ensuring proper start/stop behavior, connection state management, and event handling.
- Included tests for UdpTransportOptions to verify default values and modification capabilities.
- Enhanced service registration tests for Udp transport services in the dependency injection container.
2025-12-05 19:01:12 +02:00

57 lines
1.5 KiB
C#

namespace StellaOps.Cryptography;
/// <summary>
/// Exception thrown when a cryptographic operation violates compliance requirements.
/// </summary>
public sealed class CryptoComplianceException : Exception
{
/// <summary>
/// The compliance profile that was violated.
/// </summary>
public string ProfileId { get; }
/// <summary>
/// The hash purpose that was being processed.
/// </summary>
public string Purpose { get; }
/// <summary>
/// The algorithm that was requested.
/// </summary>
public string RequestedAlgorithm { get; }
/// <summary>
/// The algorithm that is expected for the profile and purpose.
/// </summary>
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;
}
}