search and ai stabilization work, localization stablized.
This commit is contained in:
@@ -4,6 +4,7 @@ using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using static StellaOps.Localization.T;
|
||||
|
||||
namespace StellaOps.Cryptography.Plugin.BouncyCastle;
|
||||
|
||||
@@ -38,10 +39,10 @@ public sealed partial class BouncyCastleEd25519CryptoProvider : ICryptoProvider
|
||||
}
|
||||
|
||||
public ICryptoHasher GetHasher(string algorithmId)
|
||||
=> throw new NotSupportedException("BouncyCastle Ed25519 provider does not expose hashing capabilities.");
|
||||
=> throw new NotSupportedException(_t("crypto.ed25519.no_hashing"));
|
||||
|
||||
public IPasswordHasher GetPasswordHasher(string algorithmId)
|
||||
=> throw new NotSupportedException("BouncyCastle provider does not expose password hashing capabilities.");
|
||||
=> throw new NotSupportedException(_t("crypto.provider.no_password_hashing", Name));
|
||||
|
||||
public ICryptoSigner GetSigner(string algorithmId, CryptoKeyReference keyReference)
|
||||
{
|
||||
@@ -50,7 +51,7 @@ public sealed partial class BouncyCastleEd25519CryptoProvider : ICryptoProvider
|
||||
|
||||
if (!_signingKeys.TryGetValue(keyReference.KeyId, out var entry))
|
||||
{
|
||||
throw new KeyNotFoundException($"Signing key '{keyReference.KeyId}' is not registered with provider '{Name}'.");
|
||||
throw new KeyNotFoundException(_t("crypto.provider.key_not_registered", keyReference.KeyId, Name));
|
||||
}
|
||||
|
||||
EnsureAlgorithmSupported(algorithmId);
|
||||
@@ -58,7 +59,7 @@ public sealed partial class BouncyCastleEd25519CryptoProvider : ICryptoProvider
|
||||
if (!string.Equals(entry.Descriptor.AlgorithmId, normalized, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
$"Signing key '{keyReference.KeyId}' is registered for algorithm '{entry.Descriptor.AlgorithmId}', not '{algorithmId}'.");
|
||||
_t("crypto.provider.key_algorithm_mismatch", keyReference.KeyId, entry.Descriptor.AlgorithmId, algorithmId));
|
||||
}
|
||||
|
||||
return new Ed25519SignerWrapper(entry);
|
||||
@@ -71,7 +72,7 @@ public sealed partial class BouncyCastleEd25519CryptoProvider : ICryptoProvider
|
||||
|
||||
if (signingKey.Kind != CryptoSigningKeyKind.Raw)
|
||||
{
|
||||
throw new InvalidOperationException($"Provider '{Name}' requires raw Ed25519 private key material.");
|
||||
throw new InvalidOperationException(_t("crypto.ed25519.raw_key_required", Name));
|
||||
}
|
||||
|
||||
var privateKey = NormalizePrivateKey(signingKey.PrivateKey);
|
||||
|
||||
Reference in New Issue
Block a user