Class CryptoUtils


  • public class CryptoUtils
    extends java.lang.Object
    This class provides helper methods in crypto process. Mostly with any step involving an initialization vector.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] assembleCipherTextIV​(byte[] cipherText, byte[] iv)
      Assembles cipher text and initialization vector.
      static byte[] getPlaceholderIV​(int numBytes)
      Return byte[] as placeholder for iv[].
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • assembleCipherTextIV

        public static byte[] assembleCipherTextIV​(byte[] cipherText,
                                                  byte[] iv)
        Assembles cipher text and initialization vector.
        Parameters:
        cipherText - Cipher text
        iv - Initialization vector
        Returns:
        A byte array which contains IV's length, IV and cipher text.
      • getPlaceholderIV

        public static byte[] getPlaceholderIV​(int numBytes)
        Return byte[] as placeholder for iv[].
        Parameters:
        numBytes - int
        Returns:
        byte array with length numBytes