It seems that no case was pending against you as on the date on which you applied for the post. Subsequently registered case and custody in consequence thereof is a ground on which your appointment letter can be withheld by the state. If that happens you can challenge in a court of law the withholding of your appointment letter.