Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface KeyDAO

Key DAO Interface, to be implemented by apps if they need the key management.

Hierarchy

  • KeyDAO

Implemented by

Index

Methods

Optional decrypt

  • decrypt(encrptedPrivKey: string, password: string): string
  • Optional function to decrypt the private key by yourself. Default to AES Decryption

    throws

    SdkError if decrypt failed

    Parameters

    • encrptedPrivKey: string

      The encrpted private key

    • password: string

      The password to decrypt the private key

    Returns string

    The plain private key

Optional delete

  • delete(name: string): void
  • Delete the key by name

    throws

    SdkError if the deletion fails.

    Parameters

    • name: string

      Name of the key

    Returns void

Optional encrypt

  • encrypt(privKey: string, password: string): string
  • Optional function to encrypt the private key by yourself. Default to AES Encryption

    throws

    SdkError if encrypt failed

    Parameters

    • privKey: string

      The plain private key

    • password: string

      The password to encrypt the private key

    Returns string

    The encrypted private key

read

  • Get the encrypted private key by name

    Parameters

    • name: string

      Name of the key

    Returns Wallet

    The encrypted private key object or undefined

write

  • write(name: string, key: Wallet): void
  • Save the encrypted private key to app

    throws

    SdkError if the save fails.

    Parameters

    • name: string

      Name of the key

    • key: Wallet

      The encrypted private key object

    Returns void

Generated using TypeDoc