@substrate-system/keys
    Preparing search index...

    Class AbstractKeysAbstract

    The parent key. Doesn't implement the encrypt/sign functions.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    DID: `did:key:z${string}`
    exchangeKey: CryptoKeyPair
    hasPersisted: boolean
    isSessionOnly: boolean
    writeKey: CryptoKeyPair
    _instance: any
    EXCHANGE_KEY_NAME: string
    WRITE_KEY_NAME: string

    Accessors

    • get deviceName(): Promise<string>

      The machine-readable name for this keypair.

      Returns Promise<string>

    • get privateExchangeKey(): CryptoKey

      Returns CryptoKey

    • get privateWriteKey(): CryptoKey

      Returns CryptoKey

    • get publicExchangeKey(): CryptoKey & {
          asString: (format?: SupportedEncodings) => Promise<string>;
      }

      Returns CryptoKey & { asString: (format?: SupportedEncodings) => Promise<string> }

    • get publicWriteKey(): CryptoKey & {
          asString: (format?: SupportedEncodings) => Promise<string>;
      }

      Returns CryptoKey & { asString: (format?: SupportedEncodings) => Promise<string> }

    Methods

    • Parameters

      • msg: string | ArrayBuffer | Uint8Array<ArrayBufferLike>
      • OptionalpublicKeyOrKeysize: string | CryptoKey | SymmKeyLength
      • OptionalaesAlgorithm: string

      Returns Promise<ArrayBuffer | Uint8Array<ArrayBufferLike>>

    • Parameters

      • msg: string | ArrayBuffer | Uint8Array<ArrayBufferLike>
      • OptionalpublicKeyOrKeysize: string | CryptoKey | SymmKeyLength
      • OptionalaesAlgorithm: string

      Returns Promise<string>

    • Delete the keys stored in indexedDB.

      Returns Promise<void>

    • By default, encrypt the given data to yourself, as a "note to self".

      Parameters

      • content: string | Uint8Array<ArrayBufferLike>
      • Optionalrecipient: string | CryptoKey
      • OptionalaesKeyOrInfo: string | Uint8Array<ArrayBufferLike> | CryptoKey
      • OptionalkeysizeOrAesKey: string | Uint8Array<ArrayBufferLike> | CryptoKey | SymmKeyLength
      • Optionalkeysize: SymmKeyLength

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • Parameters

      • content: string | Uint8Array<ArrayBufferLike>
      • Optionalrecipient: string | CryptoKey
      • OptionalaesKeyOrInfo: string | Uint8Array<ArrayBufferLike> | CryptoKey
      • OptionalkeysizeOrAesKey: string | Uint8Array<ArrayBufferLike> | CryptoKey | SymmKeyLength
      • Optionalkeysize: SymmKeyLength

      Returns Promise<string>

    • Get the relevant AES key.

      • if this is an ECC keypair, then use DHKE with the given public key
      • if this is RSA, use your private key to decrypt the given AES key

      Parameters

      • OptionalpublicKey: null | string | CryptoKey
      • Optionalinfo: null | string

      Returns Promise<CryptoKey>

    • Return a 32-character, DNS friendly hash of the public signing key.

      Returns Promise<string>

    • Save this keys instance to indexedDB.

      Returns Promise<void>

    • Parameters

      • Optionalformat: SupportedEncodings

      Returns Promise<string>

    • Parameters

      • Optionalformat: SupportedEncodings

      Returns Promise<string>

    • Parameters

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • Parameters

      Returns Promise<string>

    • Parameters

      • Optionalformat: SupportedEncodings

      Returns Promise<{ DID: `did:key:z${string}`; publicExchangeKey: string }>

    • Returns Promise<CryptoKeyPair>

    • Returns Promise<CryptoKeyPair>

    • Type Parameters

      Parameters

      • this: ChildKeys
      • Optionalsession: boolean

      Returns Promise<T>

    • Return a 32-character, DNS-friendly hash of the given DID.

      Parameters

      • did: `did:key:z${string}`

        A DID format string

      Returns Promise<string>

      32 character, base32 hash of the DID

    • Restore some keys from indexedDB, or create a new keypair if it doesn't exist yet.

      Type Parameters

      Parameters

      • this: ChildKeys<AbstractKeys> & typeof AbstractKeys
      • opts: Partial<{ encryptionKeyName: string; session: boolean; signingKeyName: string }> = ...

        Strings to use as keys in indexedDB, and a session boolean, is this in memory only? Or can it be persisted.

      Returns Promise<T>