SSL.Protocol.TLS12Record (ex_ssl v0.16.7)

Copy Markdown View Source

Pure TLS 1.2 AES-GCM record protection for one directional traffic epoch.

Summary

Types

cipher()

@type cipher() :: :aes_128_gcm | :aes_256_gcm

content_type()

@type content_type() :: :alert | :handshake | :application_data

t()

@type t() :: %SSL.Protocol.TLS12Record{
  cipher: cipher(),
  iv: <<_::32>>,
  key: binary(),
  sequence: non_neg_integer()
}

Functions

decrypt(state, wire)

@spec decrypt(t(), binary()) ::
  {:ok, content_type(), binary(), t()} | {:error, term()}

encrypt(state, type, plaintext)

@spec encrypt(t(), content_type(), binary()) ::
  {:ok, binary(), t()} | {:error, term()}

new(cipher, key, iv)

@spec new(term(), term(), term()) :: {:ok, t()} | {:error, term()}