Метод | Описание | |
---|---|---|
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). |
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 |