View Source WebPushEx (web_push_ex v0.1.0)

Web Push notifications via aes128gcm.

Implementation of RFC 8291, 8188, & 5689.

Summary

Functions

Decode a URL-safe Base64-encoded string with @base64_options (padding: false).

URL-safe Base64 encode a binary with @base64_options (padding: false).

Encrypt a message according to RFCs 8291, 8188, 5869.

Build and return a Request struct with details ready for sending.

Types

@type info() :: binary()
Link to this type

input_keying_material()

View Source
@type input_keying_material() :: binary()
@type key() :: binary()
@type length() :: non_neg_integer()
@type psuedo_random_key() :: binary()
@type salt() :: binary()
@type vapid_key() :: :private_key | :public_key | :subject

Functions

@spec decode(String.t()) :: binary()

Decode a URL-safe Base64-encoded string with @base64_options (padding: false).

@spec encode(binary()) :: String.t()

URL-safe Base64 encode a binary with @base64_options (padding: false).

Link to this function

encrypt_payload(payload, subscription, options \\ [])

View Source
@spec encrypt_payload(String.t(), WebPushEx.Subscription.t(), keyword()) :: binary()

Encrypt a message according to RFCs 8291, 8188, 5869.

see: https://datatracker.ietf.org/doc/html/rfc8291/#section-3.1

Link to this function

request(subscription, message, options \\ [])

View Source

Build and return a Request struct with details ready for sending.