ExCEP.Transport.Cipher behaviour (ex_cep v0.1.1)

Copy Markdown

Pluggable payload encryption behaviour for CSG CEP TS6.3 encrypted communication.

Built-in implementations:

Pass cipher: {ExCEP.Crypto.SM4, key: key_16b, mode: :cbc} in connection or server options to enable transparent SM4 encryption of all APDU ASDU payloads.

Summary

Callbacks

decrypt(ciphertext, opts)

@callback decrypt(ciphertext :: binary(), opts :: keyword()) ::
  {:ok, binary()} | {:error, term()}

encrypt(plaintext, opts)

@callback encrypt(plaintext :: binary(), opts :: keyword()) ::
  {:ok, binary()} | {:error, term()}