Crypto

siotls.crypto.HashFunction

A hash function from hashlib, e.g. hashlib.sha256.

alias of Callable[[…], HASH]

siotls.crypto.install(backend, iana_ids=None, *, duplicate='raise')

Install a crypto backend.

Parameters:
  • backend (str) – the name of the backend to install, it must be a package present in the siotls.crypto.backends namespace.

  • iana_ids (Collection[CipherSuites | NamedGroup | SignatureScheme] | None) – a list of algorithms to install, to only install a subset of the algorithms available in the backend. Use None to install them all.

  • duplicate ('raise' | 'skip' | 'override') –

    may this function be called multiple times with various backends, what to do in case this installation attempt to install a algorithm that is installed already.

    "raise" (default):

    Raise a KeyError

    "skip"

    Keep the algorithm installed already.

    "override"

    Replace the installed algorithm by he new one.