Functions#
generate_key_pair#
generate_key_pair[A: Algorithm](algorithm) -> Effect[KeyPair[A], CryptoError]A new key pair for algorithm.
| Parameter | Type | Description |
|---|---|---|
algorithm | A |
Returns Effect[KeyPair[A], CryptoError]
def generate_key_pair[A: Algorithm](self, algorithm: A) -> Effect[KeyPair[A], CryptoError]:
"""A new key pair for ``algorithm``."""
...sign#
sign(private_key, data) -> Effect[bytes, CryptoError]The signature of data (ECDSA in raw r‖s form).
| Parameter | Type | Description |
|---|---|---|
private_key | PrivateKey[Any] | |
data | Binary |
Returns Effect[bytes, CryptoError]
def sign(self, private_key: PrivateKey[Any], data: Binary) -> Effect[bytes, CryptoError]:
"""The signature of ``data`` (ECDSA in raw ``r‖s`` form)."""
...verify#
verify(public_key, signature, data) -> Effect[bool, CryptoError]Whether signature signs data; False for any problem
with the signature bytes.
| Parameter | Type | Description |
|---|---|---|
public_key | PublicKey[Any] | |
signature | Binary | |
data | Binary |
Returns Effect[bool, CryptoError]
def verify(
self, public_key: PublicKey[Any], signature: Binary, data: Binary
) -> Effect[bool, CryptoError]:
"""Whether ``signature`` signs ``data``; ``False`` for any problem
with the signature bytes."""
...public_key_of#
public_key_of[A: Algorithm](private_key) -> Effect[PublicKey[A], CryptoError]The public key of private_key.
| Parameter | Type | Description |
|---|---|---|
private_key | PrivateKey[A] |
Returns Effect[PublicKey[A], CryptoError]
def public_key_of[A: Algorithm](
self, private_key: PrivateKey[A]
) -> Effect[PublicKey[A], CryptoError]:
"""The public key of ``private_key``."""
...