  The experimental determination of the reaction rate coefficients for
production and destruction of $\text{HCN}^+$ and $\text{HNC}^+$ in collisions
with $\text{H}_2$ is presented. A variable temperature 22 pole radio frequency
ion trap was used to study the reactions in the temperature range of $17 -
250\;\text{K}$. The obtained rate coefficients for the reaction of
$\text{CN}^+$ and of $\text{HCN}^+$ with $\text{H}_2$ are close to the
collisional (Langevin) value, whereas that for the reaction of $\text{HNC}^+$
with $\text{H}_2$ is quickly decreasing with increasing temperature. The
product branching ratios for the reaction of $\text{CN}^+$ with $\text{H}_2$
are also reported and show a notable decrease of $\text{HNC}^+$ product with
respect to $\text{HCN}^+$ product with increasing temperature. These
measurements have consequences for current astrochemical models of cyanide
chemistry, in particular for the $\text{HCNH}^+$ cation.
