|
|
|
|
@ -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."); |
|
|
|
|
|