Class CryptoAES
java.lang.Object
org.apache.hadoop.hbase.io.crypto.aes.CryptoAES
AES encryption and decryption.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classHelper class for providing integrity protection. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.commons.crypto.cipher.CryptoCipherprivate final org.apache.commons.crypto.cipher.CryptoCipherprivate final CryptoAES.Integrity -
Constructor Summary
ConstructorsConstructorDescriptionCryptoAES(String transformation, Properties properties, byte[] inKey, byte[] outKey, byte[] inIv, byte[] outIv) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckTransformation(String transformation) byte[]unwrap(byte[] data, int offset, int len) Decrypts input data.byte[]wrap(byte[] data, int offset, int len) Encrypts input data.
-
Field Details
-
encryptor
-
decryptor
-
integrity
-
-
Constructor Details
-
CryptoAES
public CryptoAES(String transformation, Properties properties, byte[] inKey, byte[] outKey, byte[] inIv, byte[] outIv) throws IOException - Throws:
IOException
-
-
Method Details
-
wrap
Encrypts input data. The result composes of (msg, padding if needed, mac) and sequence num.- Parameters:
data- the input byte arrayoffset- the offset in input where the input startslen- the input length- Returns:
- the new encrypted byte array.
- Throws:
SaslException- if error happens
-
unwrap
Decrypts input data. The input composes of (msg, padding if needed, mac) and sequence num. The result is msg.- Parameters:
data- the input byte arrayoffset- the offset in input where the input startslen- the input length- Returns:
- the new decrypted byte array.
- Throws:
SaslException- if error happens
-
checkTransformation
- Throws:
IOException
-