Class CommonsCryptoAES
java.lang.Object
org.apache.hadoop.hbase.io.crypto.Cipher
org.apache.hadoop.hbase.io.crypto.aes.CommonsCryptoAES
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
private final String
static final String
private static final org.slf4j.Logger
private Properties
private SecureRandom
private final String
Fields inherited from class org.apache.hadoop.hbase.io.crypto.Cipher
BLOCK_SIZE, IV_LENGTH, KEY_LENGTH, KEY_LENGTH_BITS, RNG_ALGORITHM_KEY, RNG_PROVIDER_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateDecryptionStream
(InputStream in, Context context, byte[] iv) Create a decrypting input stream given a context and IVcreateDecryptionStream
(InputStream in, Decryptor decryptor) Create a decrypting output stream given an initialized decryptorcreateEncryptionStream
(OutputStream out, Context context, byte[] iv) Create an encrypting output stream given a context and IVcreateEncryptionStream
(OutputStream out, Encryptor encryptor) Create an encrypting output stream given an initialized encryptorReturn a decryptor for decrypting data.Get an encryptor for encrypting data.int
Return the expected initialization vector length, in bytes, or 0 if not applicableint
Return the key length required by this cipher, in bytesgetName()
Return this Cipher's nameCreate a random symmetric key(package private) SecureRandom
getRNG()
private static Properties
readCryptoProps
(org.apache.hadoop.conf.Configuration conf) Methods inherited from class org.apache.hadoop.hbase.io.crypto.Cipher
getProvider
-
Field Details
-
LOG
-
CIPHER_MODE_KEY
- See Also:
-
CIPHER_CLASSES_KEY
- See Also:
-
CIPHER_JCE_PROVIDER_KEY
- See Also:
-
CRYPTOSTREAM_BUFFERSIZE_KEY
- See Also:
-
cipherMode
-
props
-
rngAlgorithm
-
rng
-
-
Constructor Details
-
CommonsCryptoAES
-
-
Method Details
-
readCryptoProps
-
getName
Description copied from class:Cipher
Return this Cipher's name -
getKeyLength
Description copied from class:Cipher
Return the key length required by this cipher, in bytes- Specified by:
getKeyLength
in classCipher
-
getIvLength
Description copied from class:Cipher
Return the expected initialization vector length, in bytes, or 0 if not applicable- Specified by:
getIvLength
in classCipher
-
getRandomKey
Description copied from class:Cipher
Create a random symmetric key- Specified by:
getRandomKey
in classCipher
- Returns:
- the random symmetric key
-
getEncryptor
Description copied from class:Cipher
Get an encryptor for encrypting data.- Specified by:
getEncryptor
in classCipher
-
getDecryptor
Description copied from class:Cipher
Return a decryptor for decrypting data.- Specified by:
getDecryptor
in classCipher
-
createEncryptionStream
public OutputStream createEncryptionStream(OutputStream out, Context context, byte[] iv) throws IOException Description copied from class:Cipher
Create an encrypting output stream given a context and IV- Specified by:
createEncryptionStream
in classCipher
- Parameters:
out
- the output stream to wrapcontext
- the encryption contextiv
- initialization vector- Returns:
- the encrypting wrapper
- Throws:
IOException
-
createEncryptionStream
public OutputStream createEncryptionStream(OutputStream out, Encryptor encryptor) throws IOException Description copied from class:Cipher
Create an encrypting output stream given an initialized encryptor- Specified by:
createEncryptionStream
in classCipher
- Parameters:
out
- the output stream to wrapencryptor
- the encryptor- Returns:
- the encrypting wrapper
- Throws:
IOException
-
createDecryptionStream
public InputStream createDecryptionStream(InputStream in, Context context, byte[] iv) throws IOException Description copied from class:Cipher
Create a decrypting input stream given a context and IV- Specified by:
createDecryptionStream
in classCipher
- Parameters:
in
- the input stream to wrapcontext
- the encryption contextiv
- initialization vector- Returns:
- the decrypting wrapper
- Throws:
IOException
-
createDecryptionStream
Description copied from class:Cipher
Create a decrypting output stream given an initialized decryptor- Specified by:
createDecryptionStream
in classCipher
- Parameters:
in
- the input stream to wrapdecryptor
- the decryptor- Returns:
- the decrypting wrapper
- Throws:
IOException
-
getRNG
-