Class EncryptionMigrationResult
- Namespace
- Excalibur.Compliance
- Assembly
- Excalibur.Compliance.Abstractions.dll
Represents the result of a single encryption migration operation.
public sealed record EncryptionMigrationResult : IEquatable<EncryptionMigrationResult>
- Inheritance
-
EncryptionMigrationResult
- Implements
- Inherited Members
Properties
Duration
Gets the duration of the migration operation.
public TimeSpan Duration { get; init; }
Property Value
ErrorMessage
Gets the error message if the migration failed.
public string? ErrorMessage { get; init; }
Property Value
Exception
Gets the exception that caused the failure, if any.
public Exception? Exception { get; init; }
Property Value
MigratedData
Gets the migrated encrypted data if successful.
public EncryptedData? MigratedData { get; init; }
Property Value
SourceAlgorithm
Gets the source algorithm from which data was migrated.
public EncryptionAlgorithm? SourceAlgorithm { get; init; }
Property Value
SourceKeyId
Gets the source key identifier from which data was migrated.
public string? SourceKeyId { get; init; }
Property Value
Success
Gets a value indicating whether the migration succeeded.
public required bool Success { get; init; }
Property Value
TargetAlgorithm
Gets the target algorithm to which data was migrated.
public EncryptionAlgorithm? TargetAlgorithm { get; init; }
Property Value
TargetKeyId
Gets the target key identifier to which data was migrated.
public string? TargetKeyId { get; init; }
Property Value
Methods
Failed(string, Exception?, TimeSpan)
Creates a failed migration result.
public static EncryptionMigrationResult Failed(string errorMessage, Exception? exception = null, TimeSpan duration = default)
Parameters
errorMessagestringThe error message describing the failure.
exceptionExceptionThe exception that caused the failure.
durationTimeSpanThe duration before the failure.
Returns
- EncryptionMigrationResult
A failed migration result.
Succeeded(EncryptedData, TimeSpan, string, string)
Creates a successful migration result.
public static EncryptionMigrationResult Succeeded(EncryptedData migratedData, TimeSpan duration, string sourceKeyId, string targetKeyId)
Parameters
migratedDataEncryptedDataThe migrated encrypted data.
durationTimeSpanThe duration of the operation.
sourceKeyIdstringThe source key identifier.
targetKeyIdstringThe target key identifier.
Returns
- EncryptionMigrationResult
A successful migration result.