Any jailer or other public officer or employee who voluntarily permits, aids or abets in the escape or attempted escape of any person in custody by reason of a conviction or charge of any crime, commits the crime of permitting a prisoner to escape which is subject to the following penalties:
1. If the prisoner is in custody by reason of a conviction or charge of a class “A” felony, the defendant commits a class “C” felony.
2. If the prisoner is in custody by reason of a conviction or charge of any public offense other than a class “A” felony, the defendant commits a class “D” felony.