Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AbstractEThree

Hierarchy

Index

Properties

accessTokenProvider

accessTokenProvider: IAccessTokenProvider

Instance of IAccessTokenProvider implementation. Using [[getToken]] to receive JWT.

cardCrypto

cardCrypto: ICardCrypto

Instance of implementation of ICardCrypto interface.

cardManager

cardManager: CardManager

Instance of CardManager. Used to create cards with user public keys.

cardVerifier

cardVerifier: VirgilCardVerifier

Instance of VirgilCardVerifier.

identity

identity: string

Unique identifier of current user. Received from JWT token.

Protected inProcess

inProcess: boolean = false

keyEntryStorage

keyEntryStorage: IKeyEntryStorage

Instance of IKeyEntryStorage implementation. Used for storing private keys.

Protected keyLoader

keyLoader: PrivateKeyLoader

virgilCrypto

virgilCrypto: ICrypto

Instance of implementation of ICrypto interface.

Methods

backupPrivateKey

  • backupPrivateKey(pwd: string): Promise<void>
  • Uploads current user private key to Virgil Keyknox Storage.

    Parameters

    • pwd: string

    Returns Promise<void>

changePassword

  • changePassword(oldPwd: string, newPwd: string): Promise<void>
  • Changes password for access to current user private key backup.

    Parameters

    • oldPwd: string

      users old password

    • newPwd: string

      users new password

    Returns Promise<void>

cleanup

  • cleanup(): Promise<void>

decrypt

  • Decrypts data and verify signature of sender by his public key. If message is self-encrypted, omit public key parameter.

    Parameters

    Returns Promise<NodeBuffer | string>

encrypt

  • Encrypts and signs data for recipient public key or LookupResult dictionary for multiple recipients. If there is no recipient and message encrypted for the current user, omit public key.

    Parameters

    Returns Promise<NodeBuffer | string>

hasLocalPrivateKey

  • hasLocalPrivateKey(): Promise<Boolean>
  • Checks if current user has private key saved locally.

    Returns Promise<Boolean>

lookupPublicKeys

  • lookupPublicKeys(identity: string): Promise<IPublicKey>
  • lookupPublicKeys(identities: string[]): Promise<LookupResult>

register

  • register(keyPair?: IKeyPair): Promise<void>
  • Register current user in Virgil Cloud. Saves private key locally and uploads public key to cloud.

    Parameters

    Returns Promise<void>

resetPrivateKeyBackup

  • resetPrivateKeyBackup(pwd?: undefined | string): Promise<void>
  • Delete private key saved in Virgil Keyknox Storage.

    Parameters

    • Optional pwd: undefined | string

      User password for access to Virgil Keyknox Storage. If password omitted resets all Keyknox storage.

    Returns Promise<void>

restorePrivateKey

  • restorePrivateKey(pwd: string): Promise<void>
  • Downloads private key from Virgil Cloud. Use backupPrivateKey to upload the key first.

    Parameters

    • pwd: string

      User password for access to Virgil Keyknox Storage.

    Returns Promise<void>

rotatePrivateKey

  • rotatePrivateKey(): Promise<void>
  • Generates a new private key and saves locally. Replaces old public key with new one in Cloud. Used in case if old private key is lost.

    Returns Promise<void>

unregister

  • unregister(): Promise<void>
  • Unregister current user. Revokes public key in Virgil Cloud and deletes local private key.

    throws

    {RegisterRequiredError} If current user is not registered (i.e. there is no Virgil Card for this identity)

    throws

    {MultipleCardsError} If there is more than one Virgil Card for this identity

    Returns Promise<void>