Minishlink\WebPush\Encryption::createInfo PHP Method

createInfo() private static method

Returns an info record. See sections 3.2 and 3.3 of {@link https://tools.ietf.org/html/draft-ietf-httpbis-encryption-encoding-00} From {@link https://github.com/GoogleChrome/push-encryption-node/blob/master/src/encrypt.js}.
private static createInfo ( $type, $context ) : string
$type string The type of the info record
$context string The context for the record
return string
    private static function createInfo($type, $context)
    {
        if (Utils::safeStrlen($context) !== 135) {
            throw new \ErrorException('Context argument has invalid size');
        }
        return 'Content-Encoding: ' . $type . chr(0) . 'P-256' . $context;
    }