HTTP Public-Key-Pinning Builder aims to make it easy to build HTTP Public-Key-Pinning headers in your PHP projects.
As so:
<?php
use \ParagonIE\HPKPBuilder\HPKPBuilder;
$hpkp = HPKPBuilder::fromFile('/path/to/source.json');
$hpkp->sendHPKPHeader();
{
"hashes": [
{
"algo": "sha256",
"hash": "hwGEkxDWJ2oHtKv6lsvylKvhotXAAZQR1e0nq0eb2Vw="
},
{
"algo": "sha256",
"hash": "0jum0Eiu4Eg6vjn3zTmyd/RobfN6e4EagFQcz6E5ZKI="
}
],
"include-subdomains": false,
"max-age": 5184000,
"report-only": false,
"report-uri": null
}
HTTP Public-Key-Pinning Builder →
HTTP Public-Key-Pinning (MDN) →