latest.ipv8.keyvault.keys

Module Contents

Classes

Key

Interface for a public or private key.

PrivateKey

Interface for a private key.

PublicKey

Interface for a public key.

class latest.ipv8.keyvault.keys.Key

Interface for a public or private key.

abstract pub() PublicKey

Return the public key for this key material.

abstract has_secret_key() bool

Whether this key material includes a secret key.

Public keys MAY also contain a private key but not the other way around.

abstract key_to_bin() bytes

Convert this key material to bytes.

key_to_hash() bytes

Get the SHA-1 hash of this key.

class latest.ipv8.keyvault.keys.PrivateKey

Bases: Key

Interface for a private key.

has_secret_key() bool

A private key is the secret key, always True.

abstract signature(msg: bytes) bytes

Create a signature for the given data.

class latest.ipv8.keyvault.keys.PublicKey

Bases: Key

Interface for a public key.

pub() PublicKey

We are already the public key, return ourselves.

has_secret_key() bool

By default, a public key cannot be assumed to include private key material.

abstract verify(signature: bytes, msg: bytes) bool

Verify that the given signature belongs to the given message for this public key.

abstract get_signature_length() int

Get the length (in number of bytes) for signatures generated by this type of key.