latest.ipv8.keyvault.private.m2crypto

Module Contents

Classes

M2CryptoSK

A pyca implementation of a secret key, backwards compatible with Dispersy M2Crypto secret keys.

class latest.ipv8.keyvault.private.m2crypto.M2CryptoSK(curve: cryptography.hazmat.primitives.asymmetric.ec.EllipticCurve | None = None, keystring: bytes | None = None, filename: str | None = None)

Bases: latest.ipv8.keyvault.keys.PrivateKey, latest.ipv8.keyvault.public.m2crypto.M2CryptoPK

A pyca implementation of a secret key, backwards compatible with Dispersy M2Crypto secret keys.

pub() latest.ipv8.keyvault.public.m2crypto.M2CryptoPK

Get the public key for this secret key.

has_secret_key() bool

Is this is a secret key (yes it is)?

key_to_pem() bytes

Convert a key to the PEM format.

key_from_pem(pem: bytes) cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePrivateKey

Load a key from a pem certificate.

Parameters:

pem – the PEM formatted private key

signature(msg: bytes) bytes

Create a signature for a message in a backwards compatible fashion.

Parameters:

msg – the message to sign