|
21 | 21 | import com.azure.core.credential.AccessToken; |
22 | 22 | import com.azure.core.credential.TokenCredential; |
23 | 23 | import com.azure.core.credential.TokenRequestContext; |
24 | | -import com.azure.security.keyvault.keys.cryptography.models.KeyWrapAlgorithm; |
25 | 24 | import com.azure.storage.common.StorageSharedKeyCredential; |
26 | 25 | import com.azure.storage.file.datalake.DataLakeFileSystemClientBuilder; |
27 | 26 | import java.io.Serializable; |
@@ -53,6 +52,9 @@ public class AzureProperties implements Serializable { |
53 | 52 | public static final String AZURE_KEYVAULT_KEY_WRAP_ALGORITHM = |
54 | 53 | "azure.keyvault.key-wrap-algorithm"; |
55 | 54 |
|
| 55 | + // Must match KeyWrapAlgorithm.RSA_OAEP_256.getValue() from azure-security-keyvault-keys |
| 56 | + private static final String DEFAULT_KEY_WRAP_ALGORITHM = "RSA-OAEP-256"; |
| 57 | + |
56 | 58 | /** |
57 | 59 | * Configure the ADLS token credential provider used to get {@link TokenCredential}. A fully |
58 | 60 | * qualified concrete class with package that implements the {@link AdlsTokenCredentialProvider} |
@@ -136,8 +138,7 @@ public AzureProperties(Map<String, String> properties) { |
136 | 138 |
|
137 | 139 | this.keyWrapAlgorithm = |
138 | 140 | properties.getOrDefault( |
139 | | - AzureProperties.AZURE_KEYVAULT_KEY_WRAP_ALGORITHM, |
140 | | - KeyWrapAlgorithm.RSA_OAEP_256.getValue()); |
| 141 | + AzureProperties.AZURE_KEYVAULT_KEY_WRAP_ALGORITHM, DEFAULT_KEY_WRAP_ALGORITHM); |
141 | 142 | } |
142 | 143 |
|
143 | 144 | public Optional<Integer> adlsReadBlockSize() { |
@@ -204,8 +205,8 @@ public Mono<AccessToken> getToken(TokenRequestContext request) { |
204 | 205 | } |
205 | 206 | } |
206 | 207 |
|
207 | | - public KeyWrapAlgorithm keyWrapAlgorithm() { |
208 | | - return KeyWrapAlgorithm.fromString(this.keyWrapAlgorithm); |
| 208 | + public String keyWrapAlgorithm() { |
| 209 | + return this.keyWrapAlgorithm; |
209 | 210 | } |
210 | 211 |
|
211 | 212 | public Optional<String> keyVaultUrl() { |
|
0 commit comments