Class CommonsCryptoAES
java.lang.Object
org.apache.hadoop.hbase.io.crypto.Cipher
org.apache.hadoop.hbase.io.crypto.aes.CommonsCryptoAES
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringprivate final Stringstatic final Stringprivate static final org.slf4j.Loggerprivate Propertiesprivate 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 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.intReturn the expected initialization vector length, in bytes, or 0 if not applicableintReturn the key length required by this cipher, in bytesgetName()Return this Cipher's nameCreate a random symmetric key(package private) SecureRandomgetRNG()private static PropertiesreadCryptoProps(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: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
public OutputStream createEncryptionStream(OutputStream out, Encryptor encryptor) throws IOException Description copied from class:CipherCreate an encrypting output stream given an initialized encryptor- Specified by:
createEncryptionStreamin 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: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 wrapdecryptor- the decryptor- Returns:
- the decrypting wrapper
- Throws:
IOException
-
getRNG
-