PHP Класс Minishlink\WebPush\VAPID

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
createVapidKeys ( ) : array This method creates VAPID keys in case you would not be able to have a Linux bash.
getVapidHeaders ( string $audience, string $subject, string $publicKey, string $privateKey, integer $expiration = null ) : array This method takes the required VAPID parameters and returns the required header to be added to a Web Push Protocol Request.
validate ( array $vapid ) : array

Приватные методы

Метод Описание
getUncompressedKeys ( Mdanter\Ecc\Crypto\Key\PrivateKeyInterface $privateKeyObject )

Описание методов

createVapidKeys() публичный статический Метод

DO NOT create keys at each initialization! Save those keys and reuse them.
public static createVapidKeys ( ) : array
Результат array

getVapidHeaders() публичный статический Метод

This method takes the required VAPID parameters and returns the required header to be added to a Web Push Protocol Request.
public static getVapidHeaders ( string $audience, string $subject, string $publicKey, string $privateKey, integer $expiration = null ) : array
$audience string This must be the origin of the push service
$subject string This should be a URL or a 'mailto:' email address
$publicKey string The decoded VAPID public key
$privateKey string The decoded VAPID private key
$expiration integer The expiration of the VAPID JWT. (UNIX timestamp)
Результат array Returns an array with the 'Authorization' and 'Crypto-Key' values to be used as headers

validate() публичный статический Метод

public static validate ( array $vapid ) : array
$vapid array
Результат array