2.12.ipv8.attestation.identity.attestation
Module Contents
Classes
- class 2.12.ipv8.attestation.identity.attestation.Attestation(metadata_pointer: bytes, private_key: 2.12.ipv8.types.PrivateKey | None = None, signature: bytes | None = None)
Bases:
2.12.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).
- classmethod unserialize(data: bytes, public_key: 2.12.ipv8.types.PublicKey, offset: int = 0) Attestation
Read from bytes.
- classmethod create(metadata: 2.12.ipv8.types.Metadata, private_key: 2.12.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.