API_Hacienda
API_Hacienda copied to clipboard
Fix non-integer `X509SerialNumber` since OpenSSL 1.1.x
fixes the 'La firma del documento no tiene el Policy Id' validator error message
This happens with BCCR-SINPE certificates, their serial numbers are too long, so they trigger this issue: https://bugs.php.net/bug.php?id=77411
Since PHP 7.x exists serialNumberHex, not affected by this issue, but preferred to keep backwards compatibility for old setups.
Because the number is too long for hexadecimal to decimal conversion (hexdec), added a convenient function not requiring php-bcmath or php-gmp extensions being installed.