|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.io.crypto.Cipher
org.apache.hadoop.hbase.io.crypto.aes.AES
@InterfaceAudience.Private @InterfaceStability.Evolving public class 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 | |
---|---|
static int |
BLOCK_SIZE
|
static String |
CIPHER_MODE_KEY
|
static String |
CIPHER_PROVIDER_KEY
|
static int |
IV_LENGTH
|
static int |
KEY_LENGTH
|
static int |
KEY_LENGTH_BITS
|
static String |
RNG_ALGORITHM_KEY
|
static String |
RNG_PROVIDER_KEY
|
Constructor Summary | |
---|---|
AES(CipherProvider provider)
|
Method Summary | |
---|---|
InputStream |
createDecryptionStream(InputStream in,
Context context,
byte[] iv)
Create a decrypting input stream given a context and IV |
InputStream |
createDecryptionStream(InputStream in,
Decryptor d)
Create a decrypting output stream given an initialized decryptor |
OutputStream |
createEncryptionStream(OutputStream out,
Context context,
byte[] iv)
Create an encrypting output stream given a context and IV |
OutputStream |
createEncryptionStream(OutputStream out,
Encryptor e)
Create an encrypting output stream given an initialized encryptor |
Decryptor |
getDecryptor()
Return a decryptor for decrypting data. |
Encryptor |
getEncryptor()
Get an encryptor for encrypting data. |
int |
getIvLength()
Return the expected initialization vector length, in bytes, or 0 if not applicable |
int |
getKeyLength()
Return the key length required by this cipher, in bytes |
String |
getName()
Return this Cipher's name |
Key |
getRandomKey()
Create a random symmetric key |
Methods inherited from class org.apache.hadoop.hbase.io.crypto.Cipher |
---|
getProvider |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int KEY_LENGTH
public static final int KEY_LENGTH_BITS
public static final int BLOCK_SIZE
public static final int IV_LENGTH
public static final String CIPHER_MODE_KEY
public static final String CIPHER_PROVIDER_KEY
public static final String RNG_ALGORITHM_KEY
public static final String RNG_PROVIDER_KEY
Constructor Detail |
---|
public AES(CipherProvider provider)
Method Detail |
---|
public String getName()
Cipher
getName
in class Cipher
public int getKeyLength()
Cipher
getKeyLength
in class Cipher
public int getIvLength()
Cipher
getIvLength
in class Cipher
public Key getRandomKey()
Cipher
getRandomKey
in class Cipher
public Encryptor getEncryptor()
Cipher
getEncryptor
in class Cipher
public Decryptor getDecryptor()
Cipher
getDecryptor
in class Cipher
public OutputStream createEncryptionStream(OutputStream out, Context context, byte[] iv) throws IOException
Cipher
createEncryptionStream
in class Cipher
out
- the output stream to wrapcontext
- the encryption contextiv
- initialization vector
IOException
public OutputStream createEncryptionStream(OutputStream out, Encryptor e) throws IOException
Cipher
createEncryptionStream
in class Cipher
out
- the output stream to wrape
- the encryptor
IOException
public InputStream createDecryptionStream(InputStream in, Context context, byte[] iv) throws IOException
Cipher
createDecryptionStream
in class Cipher
in
- the input stream to wrapcontext
- the encryption contextiv
- initialization vector
IOException
public InputStream createDecryptionStream(InputStream in, Decryptor d) throws IOException
Cipher
createDecryptionStream
in class Cipher
in
- the input stream to wrapd
- the decryptor
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |