Class BotanUtil

java.lang.Object
net.randombit.botan.util.BotanUtil

public final class BotanUtil extends Object
  • Method Details

    • verifyInput

      public static void verifyInput(byte[] input, List<Character> allowedChars)
      Verifies input contains only allowed chars
      Parameters:
      input - encoded input
      allowedChars - allowed Character list
      Throws:
      IllegalArgumentException
    • checkSecretKey

      public static byte[] checkSecretKey(Key key) throws InvalidKeyException
      Checks the key type and content not null.
      Parameters:
      key -
      Returns:
      byte[] encoded key
      Throws:
      InvalidKeyException
    • checkKeySize

      public static void checkKeySize(jnr.ffi.Pointer ptr, int keySize, BotanUtil.FourParameterFunction<jnr.ffi.Pointer,jnr.ffi.byref.NativeLongByReference> getKeySpec) throws InvalidKeyException
      Checks whether the provided key size is valid.
      Parameters:
      ptr - the botan native reference
      keySize - the provided key size
      getKeySpec - the botan reference key spec method
      Throws:
      InvalidKeyException
    • isNullOrEmpty

      public static boolean isNullOrEmpty(byte[] value)