GitHub

KeyAgreementService

API reference for KeyAgreementService.

Functions

generate_key_pair

generate_key_pair[A: Algorithm](algorithm) -> Effect[KeyPair[A], CryptoError]

A new key pair for algorithm.

ParameterTypeDescription
algorithmA

Returns Effect[KeyPair[A], CryptoError]

def generate_key_pair[A: Algorithm](self, algorithm: A) -> Effect[KeyPair[A], CryptoError]:
    """A new key pair for ``algorithm``."""
    ...

derive_shared_secret

derive_shared_secret[A: Algorithm](private_key, public_key) -> Effect[bytes, CryptoError]

The secret shared with the holder of public_key, as raw bytes for kdf; InvalidKey for a peer key off the curve or a low-order X25519 key.

ParameterTypeDescription
private_keyPrivateKey[A]
public_keyPublicKey[A]

Returns Effect[bytes, CryptoError]

def derive_shared_secret[A: Algorithm](
    self, private_key: PrivateKey[A], public_key: PublicKey[A]
) -> Effect[bytes, CryptoError]:
    """The secret shared with the holder of ``public_key``, as raw
    bytes for ``kdf``; ``InvalidKey`` for a peer key off the curve or a
    low-order X25519 key."""
    ...

public_key_of

public_key_of[A: Algorithm](private_key) -> Effect[PublicKey[A], CryptoError]

The public key of private_key.

ParameterTypeDescription
private_keyPrivateKey[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``."""
    ...