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
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprivate final Stringprivate final Stringprivate static final org.slf4j.Loggerprivate SecureRandomprivate final StringFields 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
Constructors -
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.intReturn the expected initialization vector length, in bytes, or 0 if not applicableprivate CipherintReturn the key length required by this cipher, in bytesgetName()Return this Cipher's nameCreate a random symmetric key(package private) SecureRandomgetRNG()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:CipherReturn this Cipher's name -
getKeyLength
Description copied from class:CipherReturn the key length required by this cipher, in bytes- Specified by:
getKeyLengthin classCipher
-
getIvLength
Description copied from class:CipherReturn the expected initialization vector length, in bytes, or 0 if not applicable- Specified by:
getIvLengthin classCipher
-
getRandomKey
Description copied from class:CipherCreate a random symmetric key- Specified by:
getRandomKeyin classCipher- Returns:
- the random symmetric key
-
getEncryptor
Description copied from class:CipherGet an encryptor for encrypting data.- Specified by:
getEncryptorin classCipher
-
getDecryptor
Description copied from class:CipherReturn a decryptor for decrypting data.- Specified by:
getDecryptorin classCipher
-
createEncryptionStream
public OutputStream createEncryptionStream(OutputStream out, Context context, byte[] iv) throws IOException Description copied from class:CipherCreate an encrypting output stream given a context and IV- Specified by:
createEncryptionStreamin classCipher- Parameters:
out- the output stream to wrapcontext- the encryption contextiv- initialization vector- Returns:
- the encrypting wrapper
- Throws:
IOException
-
createEncryptionStream
Description copied from class:CipherCreate an encrypting output stream given an initialized encryptor- Specified by:
createEncryptionStreamin 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:CipherCreate a decrypting input stream given a context and IV- Specified by:
createDecryptionStreamin classCipher- Parameters:
in- the input stream to wrapcontext- the encryption contextiv- initialization vector- Returns:
- the decrypting wrapper
- Throws:
IOException
-
createDecryptionStream
Description copied from class:CipherCreate a decrypting output stream given an initialized decryptor- Specified by:
createDecryptionStreamin classCipher- Parameters:
in- the input stream to wrapd- the decryptor- Returns:
- the decrypting wrapper
- Throws:
IOException
-
getRNG
-
getJCECipherInstance
-