Table of Contents

Interface IMasterKeyRestoreService

Namespace
Excalibur.Compliance
Assembly
Excalibur.Compliance.Abstractions.dll

Restores master keys from backups and inspects backup validity for disaster recovery scenarios.

public interface IMasterKeyRestoreService

Remarks

Handles the secure import of master encryption keys (Key Encryption Keys - KEKs), reconstruction from split-knowledge recovery shares, and verification/status inspection of existing backups.

WARNING: Master key operations are highly sensitive. All operations MUST be audited and require appropriate authorization (typically multi-party approval).

Methods

GetBackupStatusAsync(string, CancellationToken)

Gets the status of existing backups for a master key.

Task<MasterKeyBackupStatus?> GetBackupStatusAsync(string keyId, CancellationToken cancellationToken)

Parameters

keyId string

The unique identifier of the master key.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<MasterKeyBackupStatus>

The backup status including when backups were created and their validity.

ImportMasterKeyAsync(MasterKeyBackup, MasterKeyImportOptions?, CancellationToken)

Imports a previously exported master key backup.

Task<MasterKeyImportResult> ImportMasterKeyAsync(MasterKeyBackup backup, MasterKeyImportOptions? options, CancellationToken cancellationToken)

Parameters

backup MasterKeyBackup

The backup data to import.

options MasterKeyImportOptions

Options controlling the import operation.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<MasterKeyImportResult>

The result of the import operation including the restored key metadata.

Exceptions

ArgumentNullException

Thrown when backup is null.

InvalidOperationException

Thrown when the backup is corrupted or cannot be decrypted.

MasterKeyBackupException

Thrown when the import fails due to validation errors.

ReconstructFromSharesAsync(BackupShare[], MasterKeyImportOptions?, CancellationToken)

Reconstructs a master key from the provided shares.

Task<MasterKeyImportResult> ReconstructFromSharesAsync(BackupShare[] shares, MasterKeyImportOptions? options, CancellationToken cancellationToken)

Parameters

shares BackupShare[]

The shares to combine (must meet the threshold).

options MasterKeyImportOptions

Options controlling the reconstruction.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<MasterKeyImportResult>

The result of the reconstruction including the restored key metadata.

Exceptions

ArgumentException

Thrown when shares is null or empty.

MasterKeyBackupException

Thrown when insufficient shares are provided or reconstruction fails.

VerifyBackupAsync(MasterKeyBackup, CancellationToken)

Verifies that a backup can be successfully restored without actually importing it.

Task<BackupVerificationResult> VerifyBackupAsync(MasterKeyBackup backup, CancellationToken cancellationToken)

Parameters

backup MasterKeyBackup

The backup to verify.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<BackupVerificationResult>

The verification result including any warnings or issues found.