3.0.ipv8.keyvault.public.m2crypto ================================= .. py:module:: 3.0.ipv8.keyvault.public.m2crypto Classes ------- .. autoapisummary:: 3.0.ipv8.keyvault.public.m2crypto.M2CryptoPK Module Contents --------------- .. py:class:: M2CryptoPK(ec_pub: cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePrivateKey | cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKey | None = None, keystring: bytes | None = None) Bases: :py:obj:`3.0.ipv8.keyvault.keys.PublicKey` A pyca implementation of a public key, backwards compatible with Dispersy M2Crypto public keys. .. py:method:: pem_to_bin(pem: bytes) -> bytes Convert a key in the PEM format into a key in the binary format. @note: Encrypted pem's are NOT supported and will silently fail. .. py:method:: key_to_pem() -> bytes Convert a key to the PEM format. .. py:method:: key_from_pem(pem: bytes) -> cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePrivateKey | cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKey Get the EC from a public PEM. .. py:method:: key_to_bin() -> bytes Get the string representation of this key. .. py:method:: get_signature_length() -> int Returns the length, in bytes, of each signature made using EC. .. py:method:: verify(signature: bytes, msg: bytes) -> bool Verify whether a given signature is correct for a message. :param signature: the given signature :param msg: the given message