2017 © Pedro Peláez
 

library hpkp-builder

Easily integrate HTTP Public-Key-Pinning headers into your application.

image

paragonie/hpkp-builder

Easily integrate HTTP Public-Key-Pinning headers into your application.

  • Monday, September 4, 2017
  • by paragonie-scott
  • Repository
  • 6 Watchers
  • 40 Stars
  • 25,002 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 3 Forks
  • 2 Open issues
  • 2 Versions
  • 7 % Grown

The README.md

HTTP Public-Key-Pinning Builder

Build Status, (*1)

This library aims to make it easy to build HTTP Public-Key-Pinning headers in your PHP projects. HPKP Builder was was created by Paragon Initiative Enterprises as part of our effort to encourage better application security practices., (*2)

Check out our other open source projects too., (*3)

PHP Version requirements

  • PHP 7.0 or newer

Build a Public-Key-Pinning header from a JSON configuration file

<?php

use \ParagonIE\HPKPBuilder\HPKPBuilder;

$hpkp = HPKPBuilder::fromFile('/path/to/source.json');
$hpkp->sendHPKPHeader();

Example JSON configuration

{
    "hashes": [
        {
            "algo": "sha256",
            "hash": "hwGEkxDWJ2oHtKv6lsvylKvhotXAAZQR1e0nq0eb2Vw="
        },
        {
            "algo": "sha256",
            "hash": "0jum0Eiu4Eg6vjn3zTmyd/RobfN6e4EagFQcz6E5ZKI="
        }
    ],
    "include-subdomains": false,
    "max-age": 5184000,
    "report-only": false,
    "report-uri": null
}

Build a Public-Key-Pinning Header

<?php

use \ParagonIE\HPKPBuilder\HPKPBuilder;

$hpkp = (new HPKPBuilder)
    ->addHash('hwGEkxDWJ2oHtKv6lsvylKvhotXAAZQR1e0nq0eb2Vw=')
    ->addHash('0jum0Eiu4Eg6vjn3zTmyd/RobfN6e4EagFQcz6E5ZKI=')
    ->addHash('JDR7yv7lvdKaM26fnKriSPiyryeYw9qi5sO8Ot7SNUQ=')
    ->includeSubdomains(true)
    ->reportOnly(true)
    ->reportUri('https://report-uri.io')
    ->sendHPKPHeader();

The Versions

04/09 2017

dev-master

9999999-dev https://paragonie.com

Easily integrate HTTP Public-Key-Pinning headers into your application.

  Sources   Download

MIT proprietary GPL-3.0+

The Requires

 

The Development Requires

security headers public key hpkp security headers hypertext public key pinning

19/06 2016

v0.1.0

0.1.0.0 https://paragonie.com

Easily integrate HTTP Public-Key-Pinning headers into your application.

  Sources   Download

MIT proprietary GPL-3.0+

The Requires

 

The Development Requires

security headers public key hpkp security headers hypertext public key pinning