Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EThree

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>

changePassword

  • changePassword(oldPwd: string, newPwd: string): Promise<void>

cleanup

  • cleanup(): Promise<void>

decrypt

decryptFile

  • Decrypts and verifies integrity of File or Blob for recipient public key. If there is no recipient and the message is encrypted for the current user, omit the public key parameter. You can define chunk size and a callback, that will be invoked on each chunk.

    The file will be read twice during this method execution:

    1. To decrypt encrypted file.
    2. To verify the validity of the signature over the decrypted file for the public key.

    Parameters

    Returns Promise<File | Blob>

encrypt

encryptFile

  • Signs and encrypts File or Blob for recipient public key or LookupResult dictionary for multiple recipients. If there is no recipient and the message is encrypted for the current user, omit the public key parameter. You can define chunk size and a callback, that will be invoked on each chunk.

    The file will be read twice during this method execution:

    1. To calculate the signature of the plaintext file.
    2. To encrypt the file with encoded signature.

    Parameters

    Returns Promise<File | Blob>

hasLocalPrivateKey

  • hasLocalPrivateKey(): Promise<Boolean>

lookupPublicKeys

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

register

  • register(keyPair?: IKeyPair): 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>

rotatePrivateKey

  • rotatePrivateKey(): 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>

Static initialize

  • Initialize a new instance of EThree which tied to specific user.

    Parameters

    • getToken: function

      Function that receive JWT.

        • (): Promise<string>
        • Returns Promise<string>

    • Default value options: EThreeInitializeOptions = {}

    Returns Promise<EThree>