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
keyIdstringThe unique identifier of the master key.
cancellationTokenCancellationTokenA 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
backupMasterKeyBackupThe backup data to import.
optionsMasterKeyImportOptionsOptions controlling the import operation.
cancellationTokenCancellationTokenA 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
sharesBackupShare[]The shares to combine (must meet the threshold).
optionsMasterKeyImportOptionsOptions controlling the reconstruction.
cancellationTokenCancellationTokenA 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
backupMasterKeyBackupThe backup to verify.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task<BackupVerificationResult>
The verification result including any warnings or issues found.