search and ai stabilization work, localization stablized.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using static StellaOps.Localization.T;
|
||||
|
||||
namespace StellaOps.Cryptography.Kms;
|
||||
|
||||
@@ -14,7 +15,7 @@ public sealed partial class FileKmsClient
|
||||
try
|
||||
{
|
||||
var record = await LoadOrCreateMetadataAsync(keyId, cancellationToken, createIfMissing: false).ConfigureAwait(false)
|
||||
?? throw new InvalidOperationException($"Key '{keyId}' does not exist.");
|
||||
?? throw new InvalidOperationException(_t("crypto.kms.key_not_found", keyId));
|
||||
return ToMetadata(record);
|
||||
}
|
||||
finally
|
||||
@@ -31,12 +32,12 @@ public sealed partial class FileKmsClient
|
||||
try
|
||||
{
|
||||
var record = await LoadOrCreateMetadataAsync(keyId, cancellationToken, createIfMissing: false).ConfigureAwait(false)
|
||||
?? throw new InvalidOperationException($"Key '{keyId}' does not exist.");
|
||||
?? throw new InvalidOperationException(_t("crypto.kms.key_not_found", keyId));
|
||||
|
||||
var version = ResolveVersion(record, keyVersion);
|
||||
if (string.IsNullOrWhiteSpace(version.PublicKey))
|
||||
{
|
||||
throw new InvalidOperationException($"Key '{keyId}' version '{version.VersionId}' does not have public key material.");
|
||||
throw new InvalidOperationException(_t("crypto.kms.key_no_public_material", keyId, version.VersionId));
|
||||
}
|
||||
|
||||
var privateKey = await LoadPrivateKeyAsync(record, version, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
Reference in New Issue
Block a user