Options
All
  • Public
  • Public/Protected
  • All
Menu

Class responsible for creating, publishing and retrieving Virgil Cards.

Hierarchy

  • CardManager

Index

Constructors

constructor

Properties

accessTokenProvider

accessTokenProvider: IAccessTokenProvider

cardVerifier

cardVerifier: ICardVerifier

client

client: CardClient

crypto

crypto: ICardCrypto

modelSigner

modelSigner: ModelSigner

retryOnUnauthorized

retryOnUnauthorized: boolean

Optional signCallback

signCallback: ISignCallback

Methods

exportCard

exportCardAsJson

exportCardAsString

  • exportCardAsString(card: ICard): string

generateRawCard

  • Generates a RawSignedModel that represents a card from cardParams. Use this method if you don't need to publish the card right away, for example if you need to first send it to your backend server to apply additional signature.

    Parameters

    Returns RawSignedModel

getCard

  • getCard(cardId: string): Promise<ICard>
  • Fetches the card by cardId from the Virgil Card Service.

    Parameters

    • cardId: string

      Id of the card to fetch.

    Returns Promise<ICard>

importCard

importCardFromJson

importCardFromString

  • importCardFromString(str: string): ICard

publishCard

publishRawCard

revokeCard

  • revokeCard(cardId: string): Promise<void>
  • Marks the Virgil Card specified by cardId as revoked. Revoked cards will have isOutdated property set to true when retrieved via CardManager.getCard method. Also revoked cards will be absent in the CardManager.searchCards result.

    Parameters

    • cardId: string

      Id of the card to revoke.

    Returns Promise<void>

searchCards

  • searchCards(identities: string | string[]): Promise<ICard[]>
  • Fetches collection of cards with the given identity from the Virgil Cards Service.

    Parameters

    • identities: string | string[]

      Identity or an array of identities of the cards to fetch.

    Returns Promise<ICard[]>