Tango.Vault (tango v0.1.2)

Copy Markdown View Source

Encryption vault for OAuth token storage.

Summary

Functions

Returns a specification to start this module under a supervisor.

Decrypts data using the appropriate cipher.

Encrypts data using the default cipher.

Gets the encryption key from application configuration.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

decrypt(ciphertext)

Decrypts data using the appropriate cipher.

Returns {:ok, plaintext} or {:error, reason}.

encrypt(plaintext)

Encrypts data using the default cipher.

Examples

encrypted = Tango.Vault.encrypt("sensitive_token")
decrypted = Tango.Vault.decrypt(encrypted)

get_encryption_key()

Gets the encryption key from application configuration.

This function is called by Cloak to get the encryption key at runtime.

start_link(config \\ [])