If a person confined in a penal institution in any other state may be a material witness in a criminal action pending in a court of record or in a grand jury investigation in this state, a circuit court judge or magistrate may certify:
The certificate shall be presented to a judge of a court of record in the other state having jurisdiction over the prisoner confined, and a notice shall be given to the attorney general of the state in which the prisoner is confined.
SDCL 23A-14A-6