Table of Contents

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

TimeSpan

ErrorMessage

Gets the error message if the migration failed.

public string? ErrorMessage { get; init; }

Property Value

string

Exception

Gets the exception that caused the failure, if any.

public Exception? Exception { get; init; }

Property Value

Exception

MigratedData

Gets the migrated encrypted data if successful.

public EncryptedData? MigratedData { get; init; }

Property Value

EncryptedData

SourceAlgorithm

Gets the source algorithm from which data was migrated.

public EncryptionAlgorithm? SourceAlgorithm { get; init; }

Property Value

EncryptionAlgorithm?

SourceKeyId

Gets the source key identifier from which data was migrated.

public string? SourceKeyId { get; init; }

Property Value

string

Success

Gets a value indicating whether the migration succeeded.

public required bool Success { get; init; }

Property Value

bool

TargetAlgorithm

Gets the target algorithm to which data was migrated.

public EncryptionAlgorithm? TargetAlgorithm { get; init; }

Property Value

EncryptionAlgorithm?

TargetKeyId

Gets the target key identifier to which data was migrated.

public string? TargetKeyId { get; init; }

Property Value

string

Methods

Failed(string, Exception?, TimeSpan)

Creates a failed migration result.

public static EncryptionMigrationResult Failed(string errorMessage, Exception? exception = null, TimeSpan duration = default)

Parameters

errorMessage string

The error message describing the failure.

exception Exception

The exception that caused the failure.

duration TimeSpan

The 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

migratedData EncryptedData

The migrated encrypted data.

duration TimeSpan

The duration of the operation.

sourceKeyId string

The source key identifier.

targetKeyId string

The target key identifier.

Returns

EncryptionMigrationResult

A successful migration result.