The electronic structure, Fermi surface, angle dependence of the cyclotron masses and extremal cross sections of the Fermi surface, phonon spectra, electron-phonon Eliashberg and transport spectral functions, temperature dependence of electrical resistivity of the HfB2 diboride were investigated from first principles using the fully relativistic and full potential linear muffin-tin orbital methods. The calculations of the dynamic matrix were carried out within the framework of the linear response theory. A good agreement with experimental data of electron-phonon spectral functions, electrical resistivity, cyclotron masses and extremal cross sections of the Fermi surface was achieved.