@@ -73,16 +73,12 @@ private IList<string> GetKmsKeyIds()
73
73
IList < string > kmsKeyIds = new List < string > ( ) ;
74
74
kmsKeyIds . Add ( Kek . KmsKeyId ) ;
75
75
string alternateKmsKeyIds = null ;
76
- if ( Kek . KmsProps != null && Kek . KmsProps . TryGetValue ( EncryptionExecutor . EncryptAlternateKmsKeyIds , out alternateKmsKeyIds ) )
76
+ if ( Kek . KmsProps != null )
77
77
{
78
- char [ ] separators = { ',' } ;
79
- string [ ] ids = alternateKmsKeyIds . Split ( separators , StringSplitOptions . RemoveEmptyEntries ) ;
80
- foreach ( string id in ids ) {
81
- if ( ! string . IsNullOrEmpty ( id ) ) {
82
- kmsKeyIds . Add ( id ) ;
83
- }
84
- }
85
- } else
78
+ Kek . KmsProps . TryGetValue ( EncryptionExecutor . EncryptAlternateKmsKeyIds ,
79
+ out alternateKmsKeyIds ) ;
80
+ }
81
+ if ( string . IsNullOrEmpty ( alternateKmsKeyIds ) )
86
82
{
87
83
var kvp = Configs . FirstOrDefault ( x =>
88
84
x . Key == EncryptionExecutor . EncryptAlternateKmsKeyIds ) ;
@@ -91,12 +87,14 @@ private IList<string> GetKmsKeyIds()
91
87
alternateKmsKeyIds = kvp . Value ;
92
88
}
93
89
}
94
- if ( alternateKmsKeyIds != null )
90
+ if ( ! string . IsNullOrEmpty ( alternateKmsKeyIds ) )
95
91
{
96
92
char [ ] separators = { ',' } ;
97
93
string [ ] ids = alternateKmsKeyIds . Split ( separators , StringSplitOptions . RemoveEmptyEntries ) ;
98
- foreach ( string id in ids ) {
99
- if ( ! string . IsNullOrEmpty ( id ) ) {
94
+ foreach ( string id in ids )
95
+ {
96
+ if ( ! string . IsNullOrEmpty ( id ) )
97
+ {
100
98
kmsKeyIds . Add ( id ) ;
101
99
}
102
100
}
0 commit comments