Hustle.Encryption (hustle v0.1.0)

This module encrypts the payload before transit to the Push Service.

Implementation of IETF RFCs rfc5869 and rfc8188

Link to this section Summary

Functions

Encrypts the payload with the given Client Public and Private keys

Link to this section Types

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

cipher_text()

@type cipher_text() :: binary()
@type p256dh() :: binary()
Link to this type

padding_length()

@type padding_length() :: non_neg_integer()
@type payload() :: binary()
@type salt() :: binary()
Link to this type

server_private_key()

@type server_private_key() :: binary()

Link to this section Functions

Link to this function

encrypt(payload, p256dh, auth, padding_length \\ 0)

@spec encrypt(
  payload :: payload(),
  p256dh :: p256dh(),
  auth :: auth(),
  padding_length :: padding_length()
) :: {cipher_text(), salt(), server_private_key()}

Encrypts the payload with the given Client Public and Private keys