virgil_sdk.cards.card module

class virgil_sdk.cards.card.Card(card_id, identity, public_key, version, created_at, signatures, previous_card_id, content_snapshot, is_outdated=False)[source]

Bases: object

The Card class is the main entity of Virgil Services. Every user/device is represented with a Virgil Card which contains a public key and information about identity.

property content_snapshot

Card content snapshot :returns: Card snapshot.

property created_at

Gets the date and time fo card creation in UTC. :returns: Creation date in UTC datetime.

classmethod from_signed_model(card_crypto, raw_singed_model, is_outdated=False)[source]

Creates card from SignedModel snapshot and signatures. :param card_crypto: Users CardCrypto witch provides cryptographic operations. :param raw_singed_model: Card RawSignedModel :param is_outdated: State of obsolescence

Returns

Card created from RawSignedModel.

classmethod from_snapshot(content_snapshot)[source]

Creates card from content snapshot. :param content_snapshot: Model content snapshot.

Returns

Card created from model content snapshot.

property id

Gets the Card ID that uniquely identifies the Card in Virgil Services. :returns: Card id.

property identity

Gets the identity value that can be anything which identifies the user in your application. :returns: User identity.

property previous_card_id

Get previous Card ID that current card is used to override to. :returns: Previous card id.

property public_key

Gets the public key. :returns: Public key.

property signatures

Gets a list of signatures. :returns: List of signatures

property version

Gets the version of the card. :returns: Card version.