org.apache.hadoop.hbase.io.crypto.aes
Class AESEncryptor

java.lang.Object
  extended by org.apache.hadoop.hbase.io.crypto.aes.AESEncryptor
All Implemented Interfaces:
Encryptor

@InterfaceAudience.Private
@InterfaceStability.Evolving
public class AESEncryptor
extends Object
implements Encryptor


Constructor Summary
AESEncryptor(Cipher cipher, SecureRandom rng)
           
 
Method Summary
 OutputStream createEncryptionStream(OutputStream out)
          Create a stream for encryption
 int getBlockSize()
          Get the cipher's internal block size
 byte[] getIv()
          Get the initialization vector
 int getIvLength()
          Get the expected length for the initialization vector
protected  void init()
           
 void reset()
          Reset state, reinitialize with the key and iv
 void setIv(byte[] iv)
          Set the initialization vector
 void setKey(Key key)
          Set the secret key
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AESEncryptor

public AESEncryptor(Cipher cipher,
                    SecureRandom rng)
Method Detail

setKey

public void setKey(Key key)
Description copied from interface: Encryptor
Set the secret key

Specified by:
setKey in interface Encryptor

getIvLength

public int getIvLength()
Description copied from interface: Encryptor
Get the expected length for the initialization vector

Specified by:
getIvLength in interface Encryptor
Returns:
the expected length for the initialization vector

getBlockSize

public int getBlockSize()
Description copied from interface: Encryptor
Get the cipher's internal block size

Specified by:
getBlockSize in interface Encryptor
Returns:
the cipher's internal block size

getIv

public byte[] getIv()
Description copied from interface: Encryptor
Get the initialization vector

Specified by:
getIv in interface Encryptor

setIv

public void setIv(byte[] iv)
Description copied from interface: Encryptor
Set the initialization vector

Specified by:
setIv in interface Encryptor

createEncryptionStream

public OutputStream createEncryptionStream(OutputStream out)
Description copied from interface: Encryptor
Create a stream for encryption

Specified by:
createEncryptionStream in interface Encryptor

reset

public void reset()
Description copied from interface: Encryptor
Reset state, reinitialize with the key and iv

Specified by:
reset in interface Encryptor

init

protected void init()


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.