@@ -15,10 +15,10 @@ public QueryableEncryptionHelpers(IConfigurationRoot appSettings)
1515 _appSettings = appSettings ;
1616 }
1717
18- public Dictionary < string , IReadOnlyDictionary < string , object > > GetKmsProviderCredentials ( string kmsProvider ,
18+ public Dictionary < string , IReadOnlyDictionary < string , object > > GetKmsProviderCredentials ( string kmsProviderName ,
1919 bool generateNewLocalKey )
2020 {
21- if ( kmsProvider == "aws" )
21+ if ( kmsProviderName == "aws" )
2222 {
2323 // start-aws-kms-credentials
2424 var kmsProviderCredentials = new Dictionary < string , IReadOnlyDictionary < string , object > > ( ) ;
@@ -27,11 +27,11 @@ public Dictionary<string, IReadOnlyDictionary<string, object>> GetKmsProviderCre
2727 { "accessKeyId" , _appSettings [ "Aws:AccessKeyId" ] } , // Your AWS access key ID
2828 { "secretAccessKey" , _appSettings [ "Aws:SecretAccessKey" ] } // Your AWS secret access key
2929 } ;
30- kmsProviderCredentials . Add ( kmsProvider , kmsOptions ) ;
30+ kmsProviderCredentials . Add ( "aws" , kmsOptions ) ;
3131 // end-aws-kms-credentials
3232 return kmsProviderCredentials ;
3333 }
34- else if ( kmsProvider == "azure" )
34+ else if ( kmsProviderName == "azure" )
3535 {
3636 // start-azure-kms-credentials
3737 var kmsProviderCredentials = new Dictionary < string , IReadOnlyDictionary < string , object > > ( ) ;
@@ -41,11 +41,11 @@ public Dictionary<string, IReadOnlyDictionary<string, object>> GetKmsProviderCre
4141 { "clientId" , _appSettings [ "Azure:ClientId" ] } , // Your Azure client ID
4242 { "clientSecret" , _appSettings [ "Azure:ClientSecret" ] } // Your Azure client secret
4343 } ;
44- kmsProviderCredentials . Add ( kmsProvider , kmsOptions ) ;
44+ kmsProviderCredentials . Add ( "azure" , kmsOptions ) ;
4545 // end-azure-kms-credentials
4646 return kmsProviderCredentials ;
4747 }
48- else if ( kmsProvider == "gcp" )
48+ else if ( kmsProviderName == "gcp" )
4949 {
5050 // start-gcp-kms-credentials
5151 var kmsProviderCredentials = new Dictionary < string , IReadOnlyDictionary < string , object > > ( ) ;
@@ -54,23 +54,23 @@ public Dictionary<string, IReadOnlyDictionary<string, object>> GetKmsProviderCre
5454 { "email" , _appSettings [ "Gcp:Email" ] } , // Your GCP email
5555 { "privateKey" , _appSettings [ "Gcp:PrivateKey" ] } // Your GCP private key
5656 } ;
57- kmsProviderCredentials . Add ( kmsProvider , kmsOptions ) ;
57+ kmsProviderCredentials . Add ( "gcp" , kmsOptions ) ;
5858 // end-gcp-kms-credentials
5959 return kmsProviderCredentials ;
6060 }
61- else if ( kmsProvider == "kmip" )
61+ else if ( kmsProviderName == "kmip" )
6262 {
6363 // start-kmip-kms-credentials
6464 var kmsProviderCredentials = new Dictionary < string , IReadOnlyDictionary < string , object > > ( ) ;
6565 var kmsOptions = new Dictionary < string , object >
6666 {
6767 { "endpoint" , _appSettings [ "Kmip:KmsEndpoint" ] } // Your KMIP KMS endpoint
6868 } ;
69- kmsProviderCredentials . Add ( kmsProvider , kmsOptions ) ;
69+ kmsProviderCredentials . Add ( "kmip" , kmsOptions ) ;
7070 // end-kmip-kms-credentials
7171 return kmsProviderCredentials ;
7272 }
73- else if ( kmsProvider == "local" )
73+ else if ( kmsProviderName == "local" )
7474 {
7575 if ( generateNewLocalKey )
7676 {
@@ -110,7 +110,7 @@ public Dictionary<string, IReadOnlyDictionary<string, object>> GetKmsProviderCre
110110 { "key" , localCustomerMasterKeyBytes }
111111 } ;
112112
113- kmsProviderCredentials . Add ( kmsProvider , localOptions ) ;
113+ kmsProviderCredentials . Add ( "local" , localOptions ) ;
114114 }
115115 // end-get-local-key
116116 catch ( Exception e )
0 commit comments