NeedleApple.Signed (needle_apple v0.1.1)

Copy Markdown View Source

Utilities for handling signed payload.

Summary

Types

The verified payload extracted from signed payload.

The root certificate that Apple offers on Apple PKI.

A cryptographically signed payload, in JSON Web Signature (JWS) format.

Functions

Verifies a signed payload.

Types

payload()

@type payload() :: map()

The verified payload extracted from signed payload.

root_cert()

@type root_cert() :: binary()

The root certificate that Apple offers on Apple PKI.

It's fine to use Apple Root CA - G3 Root.

signed_payload()

@type signed_payload() :: String.t()

A cryptographically signed payload, in JSON Web Signature (JWS) format.

Functions

verify(root_cert, signed_payload)

@spec verify(root_cert(), signed_payload()) ::
  {:ok, payload()}
  | {:error, :invalid_format | :invalid_cert_chain | :invalid_signature}

Verifies a signed payload.

Signed payloads are used in the responses of:

References