latest.ipv8.attestation.wallet.irmaexact.gabi.attributes

Copyright (c), Privacy By Design Foundation All rights reserved.

This source code has been ported from https://github.com/privacybydesign/irmago The authors of this file are not -in any way- affiliated with the original authors or organizations.

Module Contents

Classes

metadataField

Metadata position information.

MetadataAttribute

Metadata values.

Functions

int_to_str(→ bytes)

Covert an integer of unbounded size to bytes.

shortToByte(→ bytes)

Convert a short (stored in a Python int type) to bytes.

make_attribute_list(→ tuple[list[int], int])

cr =

Attributes

ExpiryFactor

metadataLength

versionField

signingDateField

validityField

keyCounterField

credentialID

latest.ipv8.attestation.wallet.irmaexact.gabi.attributes.ExpiryFactor
latest.ipv8.attestation.wallet.irmaexact.gabi.attributes.metadataLength
class latest.ipv8.attestation.wallet.irmaexact.gabi.attributes.metadataField(length: int, offset: int)

Metadata position information.

latest.ipv8.attestation.wallet.irmaexact.gabi.attributes.versionField
latest.ipv8.attestation.wallet.irmaexact.gabi.attributes.signingDateField
latest.ipv8.attestation.wallet.irmaexact.gabi.attributes.validityField
latest.ipv8.attestation.wallet.irmaexact.gabi.attributes.keyCounterField
latest.ipv8.attestation.wallet.irmaexact.gabi.attributes.credentialID
latest.ipv8.attestation.wallet.irmaexact.gabi.attributes.int_to_str(n: int) bytes

Covert an integer of unbounded size to bytes.

latest.ipv8.attestation.wallet.irmaexact.gabi.attributes.shortToByte(x: int) bytes

Convert a short (stored in a Python int type) to bytes.

class latest.ipv8.attestation.wallet.irmaexact.gabi.attributes.MetadataAttribute(version: bytes)

Metadata values.

Bytes() bytes

Convert this metadata to bytes.

setField(field: metadataField, value: bytes) None

Set a given metadata field position to a given value.

field(field: metadataField) bytes

Retrieve the value of a given field.

setSigningDate(timestamp: int | None = None) None

Set the date of signing in the metadata.

Note that the timestamp is a short in units of ExpiryFactor.

setKeyCounter(i: int) None

Set the key counter field to a given value.

SigningDate() int

Get the signing date in seconds since the epoch (like int(time.time())).

setValidityDuration(weeks: int) None

Set the value of the validity duration field (in weeks).

setExpiryDate() None

Set the default validity duration.

setExpiryDateFromTimestamp(expiry: float) None

Set the validity duration from a given expiry timestamp (like time.time()).

setCredentialTypeIdentifier(the_id: bytes) None

Set the credential type field.

latest.ipv8.attestation.wallet.irmaexact.gabi.attributes.make_attribute_list(cr: dict[str, Any], attribute_order: list[str] | None = None, validity_signing: tuple[int, int | None] | None = None) tuple[list[int], int]
cr =
{

u’attributes’: { … “name”: “value” … }, u’credential’: u’pbdf.nijmegen.address’, u’keyCounter’: 0, u’validity’: 1570123936

}.

Parameters:

attribute_order (list) – the order in which to handle the keys