Class AES
java.lang.Object
org.apache.hadoop.hbase.io.crypto.Cipher
org.apache.hadoop.hbase.io.crypto.aes.AES
AES-128, provided by the JCE
Algorithm instances are pooled for reuse, so the cipher provider and mode are configurable but fixed at instantiation.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
private final String
private final String
private static final org.slf4j.Logger
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 IVCreate a decrypting output stream given an initialized decryptorcreateEncryptionStream
(OutputStream out, Context context, byte[] iv) Create an encrypting output stream given a context and IVCreate 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 applicableprivate Cipher
int
Return the key length required by this cipher, in bytesgetName()
Return this Cipher's nameCreate a random symmetric key(package private) SecureRandom
getRNG()
Methods inherited from class org.apache.hadoop.hbase.io.crypto.Cipher
getProvider
-
Field Details
-
LOG
-
CIPHER_MODE_KEY
- See Also:
-
CIPHER_PROVIDER_KEY
- See Also:
-
rngAlgorithm
-
cipherMode
-
cipherProvider
-
rng
-
-
Constructor Details
-
AES
-
-
Method Details
-
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
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 wrape
- 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 wrapd
- the decryptor- Returns:
- the decrypting wrapper
- Throws:
IOException
-
getRNG
-
getJCECipherInstance
-