GitHub

API reference for Key.

class Key[A: Algorithm = Algorithm]

An AEAD key for algorithm.

Attributes

AttributeTypeDescription
labelstr = 'Aead.Key'

Functions

__init__

__init__(algorithm, material) -> None
ParameterTypeDescription
algorithmA
materialMaterial
def __init__(self, algorithm: A, material: Material) -> None:
    self._algorithm = algorithm
    self._material = material

to_json

to_json() -> dict[str, str]

{"_id": label, "algorithm": name}, never the key material.

Returns dict[str, str]

def to_json(self) -> dict[str, str]:
    """``{"_id": label, "algorithm": name}``, never the key material."""
    return {"_id": self.label, "algorithm": self.algorithm.name}