How can I determine whether $A_1,A_2\in GL(n,\mathbb Z)$ conjugate in $GL(n,\mathbb Z)$ and if they are, how can I find a $P\in GL(n,\mathbb Z)$ for which $A_2 = P^{-1}.A_1.P$ ?

In $GL(n,\mathbb Q)$ one could achieve this by checking if the Frobenius normal forms (FNF) are equal and if they are

$\quad\quad FNF_2 = FNF_1$

$\Leftrightarrow P_2^{-1}.A_2.P_2=P_1^{-1}.A_1.P_1$

$\Leftrightarrow A_2=M^{-1}.A_1.M\quad\quad\quad M=P_1.P_2^{-1}$

I found an algorithm which gives the FNF of a matrix with P a matrix of integers. Is there an way of performing subsequent elementary similarity transformations on $P_i$ (and hence also on $P_i^{-1}$) until $P_i\in GL(n,\mathbb Z)$ while also checking whether it is even possible to arrive at such a $P_i$?