hoplon v0.3.3 Hoplon.Crypto View Source

Link to this section Summary

Link to this section Functions

Link to this function

decode_private_key_from_pem(pem_contents, password) View Source
decode_private_key_from_pem(binary(), binary()) ::
  {:ok, Hoplon.Crypto.Records.rsa_private_key()} | {:error, Hoplon.Error.t()}

Link to this function

decode_public_key_from_pem(pem_contents) View Source
decode_public_key_from_pem(binary()) ::
  {:ok, Hoplon.Crypto.Records.rsa_public_key()} | {:error, Hoplon.Error.t()}

Link to this function

encode_private_key_to_pem(key, password) View Source
encode_private_key_to_pem(Hoplon.Crypto.Records.rsa_private_key(), String.t()) ::
  {:ok, binary()}

Link to this function

encode_public_key_to_pem(key) View Source
encode_public_key_to_pem(Hoplon.Crypto.Records.rsa_public_key()) ::
  {:ok, binary()}

Link to this function

generate_private_key() View Source
generate_private_key() :: Hoplon.Crypto.Records.rsa_private_key()

Link to this function

get_fingerprint(public_key, digest_type \\ :sha256) View Source
get_fingerprint(
  Hoplon.Crypto.Records.rsa_public_key(),
  :md5 | :sha256 | :sha512
) :: String.t()

Link to this function

get_signature(message, private_key) View Source

Link to this function

hex_decode(representation) View Source
hex_decode(String.t()) :: {:ok, binary()} | {:error, Hoplon.Error.t()}

Link to this function

hex_encode!(data) View Source
hex_encode!(binary()) :: String.t()

Link to this macro

is_private_key(maybe_rsa_private_key) View Source (macro)

Link to this macro

is_public_key(maybe_rsa_public_key) View Source (macro)

All the wrapper tools for low-level cryptography, specific to Hoplon's use-case.

Link to this function

validate_private_key(private_key) View Source
validate_private_key(term()) :: {:ok, true} | {:error, Hoplon.Error.t()}

Link to this function

validate_public_key(public_key) View Source
validate_public_key(term()) :: {:ok, true} | {:error, Hoplon.Error.t()}

Link to this function

verify_signature(message, signature, public_key) View Source