You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2021/02/22 14:38:32 UTC

[GitHub] [hadoop] steveloughran commented on a change in pull request #2707: DRAFT PR: HADOOP-17536. ABFS: Supporting customer provided encryption key

steveloughran commented on a change in pull request #2707:
URL: https://github.com/apache/hadoop/pull/2707#discussion_r580296243



##########
File path: hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClient.java
##########
@@ -88,6 +96,21 @@ private AbfsClient(final URL baseUrl, final SharedKeyCredentials sharedKeyCreden
     this.accountName = abfsConfiguration.getAccountName().substring(0, abfsConfiguration.getAccountName().indexOf(AbfsHttpConstants.DOT));
     this.authType = abfsConfiguration.getAuthType(accountName);
 
+    String encryptionKey = this.abfsConfiguration.getClientProvidedEncryptionKey();
+    if (encryptionKey != null) {
+      this.clientProvidedEncryptionKey = encryptionKey;
+      try {
+        MessageDigest digester = MessageDigest.getInstance("SHA-256");
+        digester.update(encryptionKey.getBytes());
+        this.clientProvidedEncryptionKeySHA = Base64.getEncoder().encodeToString(digester.digest());
+      } catch (NoSuchAlgorithmException e) {
+        throw new IOException(e);

Review comment:
       * will this include information about the requested algorithm? 
   * will this surface when the JVM doesn' t have the unrestricted crypto extension settings? If so, error text should mention it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org