(a) When a criminal action is pending in a court of record of this state by reason of the filing of an indictment or presentment or by reason of the commencement of a grand jury proceeding or investigation, if:

(1) There is reasonable cause to believe that a person confined in a federal prison or other federal custody, either within or outside this state, possesses information material to criminal action; and
(2) The attendance of the person as a witness in the action is desired by a party;

the court may issue a certificate, known as a writ of habeas corpus ad testificandum, addressed to the attorney general of the United States certifying all such facts and requesting the attorney general to cause the attendance of the person as a witness in that court for a specified number of days.

(b) The certificate may be issued upon application of either the state or defendant demonstrating all the facts specified in this section.
(c) Upon issuing the certificate, the court shall deliver it, or cause or authorize it to be delivered, to the attorney general or to the attorney general’s representative authorized to entertain the request.