Explicit solution of an inverse first-passage time problem for L\'{e}vy processes and counterparty credit risk