Univrse.Alg (Univrse v0.2.0) View Source

Proxy module for calling crypto functions on supported algorithms.

Supported algorithms

  • A128CBC-HS256
  • A256CBC-HS512
  • A128GCM
  • A256GCM
  • ECDH-ES+A128GCM
  • ECDH-ES+A256GCM
  • ES256K
  • HS256
  • HS512

Link to this section Summary

Functions

Calls the function with the given arguments on the specified algorithm module.

Calls decrypt() on the given algorithm, passing the arguments through.

Calls encrypt() on the given algorithm, passing the arguments through.

Calls sign() on the given algorithm, passing the arguments through.

Calls verify() on the given algorithm, passing the arguments through.

Link to this section Functions

Link to this function

call(alg, func, args \\ [])

View Source

Specs

call(binary(), atom(), list()) :: any() | {:error, any()}

Calls the function with the given arguments on the specified algorithm module.

Link to this function

decrypt(encrypted, alg, key, opts \\ [])

View Source

Specs

decrypt(binary(), binary(), Key.t(), keyword()) ::
  {:ok, binary()} | {:error, any()}

Calls decrypt() on the given algorithm, passing the arguments through.

Link to this function

encrypt(message, alg, key, opts \\ [])

View Source

Specs

encrypt(binary(), binary(), Key.t(), keyword()) ::
  {:ok, binary(), map()} | {:error, any()}

Calls encrypt() on the given algorithm, passing the arguments through.

Specs

sign(binary(), binary(), Key.t()) :: {:ok, binary()} | {:error, any()}

Calls sign() on the given algorithm, passing the arguments through.

Link to this function

verify(message, sig, alg, key)

View Source

Specs

verify(binary(), binary(), binary(), Key.t()) :: boolean() | {:error, any()}

Calls verify() on the given algorithm, passing the arguments through.