This is an example implementation of an identity management class.

You almost certainly want to build your own.

Implements

Constructors

Properties

identityPublic?: CryptoKey
identitySecret?: CryptoKey
myIdentityString?: string
oneTimeKeys: Map<string, CryptoKey>
preKey?: PreKeyPair

Methods

  • Export identity keypair data for storage. Returns an object with hex-encoded keys that can be stored by the application. Uses raw format for better browser compatibility.

    Parameters

    • identitySecret: CryptoKey

    Returns Promise<{ pk: string; sk: string }>

  • Load an Ed25519 keypair from stored data. This method now expects the user to provide the stored data directly.

    Parameters

    • OptionalstoredData: { pk: string; sk: string }

      Object with 'sk' and 'pk' hex strings

    Returns Promise<IdentityKeyPair>