Check out this Wikipedia article on the rotation of vectors in $\mathbb{R}^3$. It describes the transformation matrix used for the rotation of a vector about an arbitrary unit vector by an arbitrary angle.
Regarding the computation of the rotation angle, we consider the rotation of an arbitrary vector $\vec{A}$ about some unit vector (the rotation axis) by an angle of $\theta$ to get $\vec{B}$. The dot product of the two gives $\vec{A}\cdot\vec{B} = |\vec{A}||\vec{B}|\cos{\theta}$, or more explicitly,
$$\cos{\theta} = \frac{\vec{A}\cdot\vec{B}}{|\vec{A}||\vec{B}|}$$ This allows you to compute the rotation angle ($\theta$) from the vectors before and after rotation.
As for the computation of the rotation axis, we simply take and normalize the cross product of $\vec{A}$ with $\vec{B}$. I hope you can see why.