diff --git a/src/CryptoAgent/Startup.cs b/src/CryptoAgent/Startup.cs index 9902a07..84c28cd 100644 --- a/src/CryptoAgent/Startup.cs +++ b/src/CryptoAgent/Startup.cs @@ -1,4 +1,4 @@ -using Bit.CryptoAgent.Repositories; +using Bit.CryptoAgent.Repositories; using Bit.CryptoAgent.Services; using JsonFlatFileDataStore; using Microsoft.AspNetCore.Builder; @@ -66,6 +66,28 @@ namespace Bit.CryptoAgent throw new Exception("No azure key vault configured."); } } + else if (rsaKeyProvider == "gcp") + { + if (!string.IsNullOrWhiteSpace(settings.RsaKey?.GoogleCloudKeyId)) + { + services.AddSingleton(); + } + else + { + throw new Exception("No gcp kms configured."); + } + } + else if (rsaKeyProvider == "aws") + { + if (!string.IsNullOrWhiteSpace(settings.RsaKey?.AwsAccessKeyId)) + { + services.AddSingleton(); + } + else + { + throw new Exception("No aws kms configured."); + } + } else { throw new Exception("Unknown rsa key provider.");