PHP 클래스 Minishlink\WebPush\Encryption

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

공개 메소드들

메소드 설명
encrypt ( string $payload, string $userPublicKey, string $userAuthToken, boolean $nativeEncryption ) : array
padPayload ( string $payload, boolean $maxLengthToPad ) : string

비공개 메소드들

메소드 설명
createContext ( $clientPublicKey, $serverPublicKey ) : string Creates a context for deriving encyption parameters.
createInfo ( $type, $context ) : string 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}.
hkdf ( $salt, $ikm, $info, $length ) : string HMAC-based Extract-and-Expand Key Derivation Function (HKDF).

메소드 상세

encrypt() 공개 정적인 메소드

public static encrypt ( string $payload, string $userPublicKey, string $userAuthToken, boolean $nativeEncryption ) : array
$payload string With padding
$userPublicKey string Base 64 encoded (MIME or URL-safe)
$userAuthToken string Base 64 encoded (MIME or URL-safe)
$nativeEncryption boolean Use OpenSSL (>PHP7.1)
리턴 array

padPayload() 공개 정적인 메소드

public static padPayload ( string $payload, boolean $maxLengthToPad ) : string
$payload string
$maxLengthToPad boolean
리턴 string padded payload (plaintext)