Package net.randombit.botan.util
Class BotanUtil
java.lang.Object
net.randombit.botan.util.BotanUtil
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckKeySize(jnr.ffi.Pointer ptr, int keySize, BotanUtil.FourParameterFunction<jnr.ffi.Pointer, jnr.ffi.byref.NativeLongByReference> getKeySpec) Checks whether the provided key size is valid.static byte[]checkSecretKey(Key key) Checks the key type and content not null.static booleanisNullOrEmpty(byte[] value) static voidverifyInput(byte[] input, List<Character> allowedChars) Verifies input contains only allowed chars
-
Method Details
-
verifyInput
Verifies input contains only allowed chars- Parameters:
input- encoded inputallowedChars- allowed Character list- Throws:
IllegalArgumentException
-
checkSecretKey
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 InvalidKeyExceptionChecks whether the provided key size is valid.- Parameters:
ptr- the botan native referencekeySize- the provided key sizegetKeySpec- the botan reference key spec method- Throws:
InvalidKeyException
-
isNullOrEmpty
public static boolean isNullOrEmpty(byte[] value)
-