PHP 클래스 Minishlink\WebPush\VAPID

파일 보기 프로젝트 열기: minishlink/web-push 1 사용 예제들

공개 메소드들

메소드 설명
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