Interface Verifier

A Verifier is responsible for performing the verification using a particular method, such as via QR code or SAS (emojis).

A verifier object can be created by calling VerificationRequest.beginVerification; one is also created automatically when a m.key.verification.start event is received for an existing VerificationRequest.

Once a verifier object is created, the verification can be started by calling the verify method.

Hierarchy

Implemented by

Accessors

  • get hasBeenCancelled(): boolean
  • Returns true if the verification has been cancelled, either by us or the other side.

    Returns boolean

Methods

  • Cancel a verification.

    We will send an m.key.verification.cancel if the verification is still in flight. The verification promise will reject, and a Cancel will be emitted.

    Parameters

    • e: Error

      the reason for the cancellation.

    Returns void

  • Get the details for reciprocating QR code verification, if one is in progress

    Returns null, unless this verifier is for reciprocating a QR-code-based verification (ie, the other user has already scanned our QR code), and we are waiting for the user to confirm.

    Returns null | ShowQrCodeCallbacks

  • Adds the listener function to the end of the listeners array for the event named event.

    No checks are made to see if the listener has already been added. Multiple calls passing the same combination of event and listener will result in the listener being added, and called, multiple times.

    By default, event listeners are invoked in the order they are added. The prependListener method can be used as an alternative to add the event listener to the beginning of the listeners array.

    Type Parameters

    Parameters

    Returns Verifier

    a reference to the EventEmitter, so that calls can be chained.

  • Removes all listeners, or those of the specified event.

    It is bad practice to remove listeners added elsewhere in the code, particularly when the EventEmitter instance was created by some other component or module (e.g. sockets or file streams).

    Parameters

    Returns Verifier

    a reference to the EventEmitter, so that calls can be chained.

  • Start the key verification, if it has not already been started.

    This means sending a m.key.verification.start if we are the first responder, or a m.key.verification.accept if the other side has already sent a start event.

    Returns Promise<void>

    Promise which resolves when the verification has completed, or rejects if the verification is cancelled or times out.

Generated using TypeDoc