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/03/25 19:07:24 UTC

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

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



##########
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:
       Looks like this is a common Exception, do we need to mention explicitly?
   https://stackoverflow.com/questions/48040299/java-security-nosuchalgorithmexception-sha3-384-messagedigest-not-available-w




-- 
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