latest.ipv8.attestation.identity.attestation

Module Contents

Classes

Attestation

A pointer to Metadata.

class latest.ipv8.attestation.identity.attestation.Attestation(metadata_pointer: bytes, private_key: latest.ipv8.types.PrivateKey | None = None, signature: bytes | None = None)

Bases: latest.ipv8.attestation.signed_object.AbstractSignedObject

A pointer to Metadata.

An Attestation does not and should not contain an index. An Attestation does not and should not contain a reference to the public key (directly).

get_plaintext() bytes

Convert to bytes.

classmethod unserialize(data: bytes, public_key: latest.ipv8.types.PublicKey, offset: int = 0) Attestation

Read from bytes.

classmethod create(metadata: latest.ipv8.types.Metadata, private_key: latest.ipv8.types.PrivateKey) Attestation

Create an attestation for given metadata using our key.

to_database_tuple() tuple[bytes, bytes]

Get a representation of this Attestation as two byte strings (metadata hash and signature).

Returns:

the two byte strings for database insertion.

classmethod from_database_tuple(metadata_pointer: bytes, signature: bytes) Attestation

Create a Token from a two-byte-string representation (metadata hash and signature).

Parameters:
  • metadata_pointer – the hash of the Attestation.

  • signature – the signature over the plaintext Attestation.

__str__() str

Convert this attestation to a human-readable string.