Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Keystore

Hierarchy

  • Keystore

Index

Constructors

constructor

  • new Keystore(theCrypto: Crypto, id: string, origin?: undefined | string): Keystore
  • Parameters

    • theCrypto: Crypto
    • id: string
    • Optional origin: undefined | string

    Returns Keystore

Properties

crypto

crypto: Crypto

id

id: string

origin

origin: string | undefined

version

version: number = 3

Methods

checkPassword

  • checkPassword(password: string): boolean
  • Parameters

    • password: string

    Returns boolean

decrypt

  • Parameters

    • password: string

    Returns HexString

derivedKey

  • derivedKey(password: string): Buffer
  • Parameters

    • password: string

    Returns Buffer

extendedPrivateKey

  • Parameters

    • password: string

    Returns ExtendedPrivateKey

isEmpty

  • isEmpty(): boolean
  • Returns boolean

isFromCkbCli

  • isFromCkbCli(): boolean
  • Returns boolean

save

  • save(dir: string, __namedParameters?: { name: string; overwrite: boolean }): void
  • Keystore file default name is ${id}.json.

    Parameters

    • dir: string
    • Default value __namedParameters: { name: string; overwrite: boolean } = {}
      • name: string
      • overwrite: boolean

    Returns void

toJson

  • toJson(): string
  • Returns string

Static create

  • Parameters

    • extendedPrivateKey: ExtendedPrivateKey
    • password: string
    • Default value options: { iv?: Buffer; salt?: Buffer } = {}
      • Optional iv?: Buffer
      • Optional salt?: Buffer

    Returns Keystore

Static createEmpty

  • Returns Keystore

Static fromJson

  • Parameters

    • json: string

    Returns Keystore

Static load

  • Load keystore file from path.

    Parameters

    • path: string

    Returns Keystore

Static mac

  • Parameters

    • derivedKey: Buffer
    • ciphertext: Buffer

    Returns HexStringWithoutPrefix

Static scryptOptions

  • scryptOptions(kdfparams: KdfParams): ScryptOptions
  • Parameters

    Returns ScryptOptions

Generated using TypeDoc