Skip to content

Commit

Permalink
HBASE-27089 Add “commons.crypto.stream.buffer.size” configuration (#4491
Browse files Browse the repository at this point in the history
)

Co-authored-by: wenwj0 <wenweijian2@huawei.com>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 7ff927d)
  • Loading branch information
wenwj0 authored and Apache9 committed Aug 21, 2022
1 parent 1227704 commit 999cc74
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.Properties;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.crypto.cipher.CryptoCipherFactory;
import org.apache.commons.crypto.stream.CryptoInputStream;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.io.crypto.Cipher;
import org.apache.hadoop.hbase.io.crypto.CipherProvider;
Expand All @@ -48,6 +49,8 @@ public class CommonsCryptoAES extends Cipher {
public static final String CIPHER_MODE_KEY = "hbase.crypto.commons.mode";
public static final String CIPHER_CLASSES_KEY = "hbase.crypto.commons.cipher.classes";
public static final String CIPHER_JCE_PROVIDER_KEY = "hbase.crypto.commons.cipher.jce.provider";
public static final String CRYPTOSTREAM_BUFFERSIZE_KEY =
"hbase.crypto.commons.cryptoStream.bufferSize";

private final String cipherMode;
private Properties props;
Expand Down Expand Up @@ -81,6 +84,8 @@ private static Properties readCryptoProps(Configuration conf) {

props.setProperty(CryptoCipherFactory.CLASSES_KEY, conf.get(CIPHER_CLASSES_KEY, ""));
props.setProperty(CryptoCipherFactory.JCE_PROVIDER_KEY, conf.get(CIPHER_JCE_PROVIDER_KEY, ""));
props.setProperty(CryptoInputStream.STREAM_BUFFER_SIZE_KEY,
conf.get(CRYPTOSTREAM_BUFFERSIZE_KEY, ""));

return props;
}
Expand Down

0 comments on commit 999cc74

Please sign in to comment.