Refactor code structure for improved readability and maintainability

This commit is contained in:
master
2025-11-06 19:30:31 +02:00
parent 822e3b6037
commit 62086949a4
22 changed files with 70 additions and 52 deletions

View File

@@ -4,7 +4,7 @@ using Google.Protobuf.WellKnownTypes;
namespace StellaOps.Cryptography.Kms;
internal interface IGcpKmsFacade : IDisposable
public interface IGcpKmsFacade : IDisposable
{
Task<GcpSignResult> SignAsync(string versionName, ReadOnlyMemory<byte> digest, CancellationToken cancellationToken);
@@ -15,11 +15,11 @@ internal interface IGcpKmsFacade : IDisposable
Task<GcpPublicKeyMaterial> GetPublicKeyAsync(string versionName, CancellationToken cancellationToken);
}
internal sealed record GcpSignResult(string VersionName, byte[] Signature);
public sealed record GcpSignResult(string VersionName, byte[] Signature);
internal sealed record GcpCryptoKeyMetadata(string KeyName, string? PrimaryVersionName, DateTimeOffset CreateTime);
public sealed record GcpCryptoKeyMetadata(string KeyName, string? PrimaryVersionName, DateTimeOffset CreateTime);
internal enum GcpCryptoKeyVersionState
public enum GcpCryptoKeyVersionState
{
Unspecified = 0,
PendingGeneration = 1,
@@ -32,13 +32,13 @@ internal enum GcpCryptoKeyVersionState
GenerationFailed = 8,
}
internal sealed record GcpCryptoKeyVersionMetadata(
public sealed record GcpCryptoKeyVersionMetadata(
string VersionName,
GcpCryptoKeyVersionState State,
DateTimeOffset CreateTime,
DateTimeOffset? DestroyTime);
internal sealed record GcpPublicKeyMaterial(string VersionName, string Algorithm, string Pem);
public sealed record GcpPublicKeyMaterial(string VersionName, string Algorithm, string Pem);
internal sealed class GcpKmsFacade : IGcpKmsFacade
{