pub fn check_key_len(key: &[u8]) -> Result<(), Error>
Check that the key is of valid length, or return a descriptive error.