Expose RSA keys only for now, because we are waiting for more browsers to support ECC.

Create an instance with Keys.create b/c async.

Constructors

  • Parameters

    • opts: ConstructorOpts

    Returns Keys

Properties

DID: `did:key:z${string}`
ENCRYPTION_KEY_NAME: string = DEFAULT_ENC_NAME
SIGNING_KEY_NAME: string = DEFAULT_SIG_NAME

Accessors

  • get privateKey(): CryptoKey
  • Returns CryptoKey

  • get publicEncryptKey(): CryptoKey
  • Returns CryptoKey

  • get publicSignKey(): CryptoKey
  • Returns CryptoKey

Methods

  • Parameters

    • msg: EncryptedMessage

    Returns Promise<Uint8Array<ArrayBufferLike>>

  • Parameters

    • key: string | Uint8Array<ArrayBufferLike>

    Returns Promise<Uint8Array<ArrayBufferLike>>

  • Parameters

    • msg: string | Uint8Array<ArrayBufferLike>

    Returns Promise<string>

  • Parameters

    • msg: EncryptedMessage

    Returns Promise<string>

  • Returns Promise<string>

  • Get the public encryption key as a string.

    Returns Promise<string>

    Return a string b/c mostly would use this for serializing the public encryption key.

  • Returns Promise<void>

  • Sign a string. Return the signature as Uint8Array.

    Parameters

    • msg: Msg

      The message to sign

    • Optionalcharsize: CharSize

    Returns Promise<Uint8Array<ArrayBufferLike>>

    The signature

  • Parameters

    • msg: Msg
    • Optionalcharsize: CharSize

    Returns Promise<string>

  • 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.

    Parameters

    • opts: { encryptionKeyName: any; signingKeyName: any } = ...

      Strings to use as keys in indexedDB.

    Returns Promise<Keys>