GitHub

PrivateKey

API reference for PrivateKey.

class PrivateKey[A: Algorithm = Algorithm]

A signing key for algorithm.

Attributes

AttributeTypeDescription
labelstr = 'Signature.PrivateKey'

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}