Class BaseCryptCodecHandler

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] applyPageNumber​(byte[] key, int offset, int pageNumber)
      Returns a copy of the given key with the bytes of the given pageNumber applied at the given offset using XOR.
      static byte[] fill​(byte[] bytes, int value)
      Fills the given array with the given value and returns it.
      static byte[] fixToLength​(byte[] bytes, int len)  
      static byte[] fixToLength​(byte[] bytes, int len, int padByte)  
      static byte[] hash​(Digest digest, byte[] bytes)
      Hashes the given bytes using the given digest and returns the result.
      static byte[] hash​(Digest digest, byte[] bytes1, byte[] bytes2)
      Hashes the given bytes1 and bytes2 using the given digest and returns the result.
      static byte[] hash​(Digest digest, byte[] bytes1, byte[] bytes2, int resultLen)
      Hashes the given bytes1 and bytes2 using the given digest and returns the hash fixed to the given length.
      static byte[] hash​(Digest digest, byte[] bytes, int resultLen)
      Hashes the given bytes using the given digest and returns the hash fixed to the given length.
      String toString()  
      static ByteBuffer wrap​(byte[] bytes)  
    • Method Detail

      • applyPageNumber

        public static byte[] applyPageNumber​(byte[] key,
                                             int offset,
                                             int pageNumber)
        Returns a copy of the given key with the bytes of the given pageNumber applied at the given offset using XOR.
      • hash

        public static byte[] hash​(Digest digest,
                                  byte[] bytes)
        Hashes the given bytes using the given digest and returns the result.
      • hash

        public static byte[] hash​(Digest digest,
                                  byte[] bytes1,
                                  byte[] bytes2)
        Hashes the given bytes1 and bytes2 using the given digest and returns the result.
      • hash

        public static byte[] hash​(Digest digest,
                                  byte[] bytes,
                                  int resultLen)
        Hashes the given bytes using the given digest and returns the hash fixed to the given length.
      • hash

        public static byte[] hash​(Digest digest,
                                  byte[] bytes1,
                                  byte[] bytes2,
                                  int resultLen)
        Hashes the given bytes1 and bytes2 using the given digest and returns the hash fixed to the given length.
      • fixToLength

        public static byte[] fixToLength​(byte[] bytes,
                                         int len)
        Returns:
        a byte array of the given length, truncating or padding the given byte array as necessary.
      • fixToLength

        public static byte[] fixToLength​(byte[] bytes,
                                         int len,
                                         int padByte)
        Returns:
        a byte array of the given length, truncating or padding the given byte array as necessary using the given padByte.
      • wrap

        public static ByteBuffer wrap​(byte[] bytes)
        Returns:
        a new ByteBuffer wrapping the given bytes with the appropriate byte order
      • fill

        public static byte[] fill​(byte[] bytes,
                                  int value)
        Fills the given array with the given value and returns it.