Verifies that key is non-empty and does not exceed the maximum key length.
if the key is empty or too long.