Class CryptoAES

java.lang.Object
org.apache.hadoop.hbase.io.crypto.aes.CryptoAES

@Private @Evolving public class CryptoAES extends Object
AES encryption and decryption.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private static class 
    Helper class for providing integrity protection.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final org.apache.commons.crypto.cipher.CryptoCipher
     
    private final org.apache.commons.crypto.cipher.CryptoCipher
     
    private final CryptoAES.Integrity
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    CryptoAES(String transformation, Properties properties, byte[] inKey, byte[] outKey, byte[] inIv, byte[] outIv)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • wrap

      public byte[] wrap(byte[] data, int offset, int len) throws SaslException
      Encrypts input data. The result composes of (msg, padding if needed, mac) and sequence num.
      Parameters:
      data - the input byte array
      offset - the offset in input where the input starts
      len - the input length
      Returns:
      the new encrypted byte array.
      Throws:
      SaslException - if error happens
    • unwrap

      public byte[] unwrap(byte[] data, int offset, int len) throws SaslException
      Decrypts input data. The input composes of (msg, padding if needed, mac) and sequence num. The result is msg.
      Parameters:
      data - the input byte array
      offset - the offset in input where the input starts
      len - the input length
      Returns:
      the new decrypted byte array.
      Throws:
      SaslException - if error happens
    • checkTransformation

      private void checkTransformation(String transformation) throws IOException
      Throws:
      IOException