@substrate-system/webcrypto-x3dh
    Preparing search index...

    Class X3DH

    X3DH implementation using Web Crypto API. Keys are passed in instead of being managed internally.

    Index

    Constructors

    Properties

    identityString: string
    keys: X3DHKeys
    oneTimeKeys: Map<string, CryptoKey>

    Methods

    • Generates and signs a bundle of one-time keys. Stores them locally for later use.

      Parameters

      • OptionalnumKeys: number = 100

      Returns Promise<SignedBundle>

    • Sets the identity string for the current user.

      Parameters

      • id: string

      Returns void

    • Sign a pre-key with the identity key. This is what should be used for signed pre-keys in X3DH.

      Parameters

      • signingKey: CryptoKey
      • preKey: CryptoKey

      Returns Promise<string>

    • Returns Promise<CryptoKeyPair>

    • Parameters

      • idKeys: { privateWriteKey: CryptoKey; publicWriteKey: CryptoKey }
      • preKeypair: { privateKey: CryptoKey; publicKey: CryptoKey }

      Returns X3DHKeys