Browse Source

register gcp and aws rsa key services

pull/2/head
Kyle Spearrin 4 years ago
parent
commit
ad65021e70
  1. 24
      src/CryptoAgent/Startup.cs

24
src/CryptoAgent/Startup.cs

@ -1,4 +1,4 @@ @@ -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 @@ -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<IRsaKeyService, GoogleCloudKmsRsaKeyService>();
}
else
{
throw new Exception("No gcp kms configured.");
}
}
else if (rsaKeyProvider == "aws")
{
if (!string.IsNullOrWhiteSpace(settings.RsaKey?.AwsAccessKeyId))
{
services.AddSingleton<IRsaKeyService, AwsKmsRsaKeyService>();
}
else
{
throw new Exception("No aws kms configured.");
}
}
else
{
throw new Exception("Unknown rsa key provider.");

Loading…
Cancel
Save