View Source CloudfrontSigner.Distribution (cloudfront_signer v1.0.0)

Representation of a cloudfront distribution for the purpose of computing a signed url. We need the address of the distribution and the private key for RSA signature generation

Summary

Functions

Creates a Distribution.t record from the contents of Application.get_env(app, scope)

Creates a Distribution struct from a map of attributes.

Types

t()

@type t() :: %CloudfrontSigner.Distribution{
  domain: term(),
  key_pair_id: term(),
  private_key: term()
}

Functions

from_config(app, scope)

@spec from_config(atom(), atom()) :: t()

Creates a Distribution.t record from the contents of Application.get_env(app, scope)

from_map(map)

@spec from_map(map()) :: t()

Creates a Distribution struct from a map of attributes.

If the map contains a :private_key that is a binary PEM string, it will be decoded into its internal representation. Other attributes (:domain and :key_pair_id) are copied as-is into the struct.