Class CryptoAES
java.lang.Object
org.apache.hadoop.hbase.io.crypto.aes.CryptoAES
AES encryption and decryption.
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static class
Helper class for providing integrity protection. -
Field Summary
Modifier and TypeFieldDescriptionprivate final org.apache.commons.crypto.cipher.CryptoCipher
private final org.apache.commons.crypto.cipher.CryptoCipher
private final CryptoAES.Integrity
-
Constructor Summary
ConstructorDescriptionCryptoAES
(String transformation, Properties properties, byte[] inKey, byte[] outKey, byte[] inIv, byte[] outIv) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
checkTransformation
(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
-