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

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: undefined | string; overwrite: undefined | false | true }): void
  • Keystore file default name is ${id}.json.

    Parameters

    • dir: string
    • Optional __namedParameters: { name: undefined | string; overwrite: undefined | false | true }
      • name: undefined | string
      • overwrite: undefined | false | true

    Returns void

toJson

  • toJson(): string
  • Returns string

Static create

  • create(extendedPrivateKey: ExtendedPrivateKey, password: string, options?: undefined | { iv?: Buffer; salt?: Buffer }): Keystore
  • Parameters

    • extendedPrivateKey: ExtendedPrivateKey
    • password: string
    • Optional options: undefined | { iv?: Buffer; 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