Interface IKeyRotationScheduler
- Namespace
- Excalibur.Compliance
- Assembly
- Excalibur.Compliance.Abstractions.dll
Provides scheduling and execution of automatic key rotation operations.
public interface IKeyRotationScheduler
Remarks
Automatic key rotation is required for compliance with SOC 2 and GDPR standards. This interface supports: - Policy-based rotation (e.g., 90-day default) - Per-key-purpose rotation schedules - Zero-downtime rotation with versioning
Methods
CheckAndRotateAsync(CancellationToken)
Checks all managed keys and rotates any that are due according to their policies.
Task<KeyRotationBatchResult> CheckAndRotateAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task<KeyRotationBatchResult>
A result summarizing the rotation operations performed.
ForceRotateAsync(string, string, CancellationToken)
Forces immediate rotation of a specific key regardless of its schedule.
Task<KeyRotationResult> ForceRotateAsync(string keyId, string reason, CancellationToken cancellationToken)
Parameters
keyIdstringThe key identifier to rotate.
reasonstringThe reason for the forced rotation (for audit purposes).
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task<KeyRotationResult>
The result of the rotation operation.
GetNextRotationTimeAsync(string, CancellationToken)
Gets the next scheduled rotation time for a specific key.
Task<DateTimeOffset?> GetNextRotationTimeAsync(string keyId, CancellationToken cancellationToken)
Parameters
keyIdstringThe key identifier.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task<DateTimeOffset?>
The next rotation time, or null if the key is not found or has no rotation schedule.
IsRotationDueAsync(string, CancellationToken)
Checks if a specific key is due for rotation according to its policy.
Task<bool> IsRotationDueAsync(string keyId, CancellationToken cancellationToken)
Parameters
keyIdstringThe key identifier to check.
cancellationTokenCancellationTokenA token to cancel the operation.