QXmpp::Uri::OmemoFingerprint Struct

struct QXmpp::Uri::OmemoFingerprint
Header: #include <QXmppUri.h>
Since: QXmpp 1.18

Public Functions

bool operator==(const QXmpp::Uri::OmemoFingerprint &) const

Public Variables

uint32_t deviceId
QByteArray keyId

Detailed Description

The fingerprint of an OMEMO device in the URI format of Conversations, not formally specified.

Conversations includes the fingerprints of the devices of an account in the URIs it shares, e.g. in QR codes, so that scanning them verifies the keys:

xmpp:alice@example.org?omemo-sid-123456=08a6...;omemo-sid-654321=c7f1...

Each fingerprint is a key-value pair omemo-sid-<device ID>=<key> with the key encoded as Base16. The fingerprints can be the only items of the query (without a query type) or follow any query, e.g. xmpp:alice@example.org?message;omemo-sid-123456=08a6.... Older versions of Conversations used omemo=<key> without the device ID, it is parsed with the device ID 0. See QXmppUri::omemoFingerprints().

The format of the key depends on the OMEMO version, the URI doesn't tell which one is used:

  • OMEMO 0 (eu.siacs.conversations.axolotl), used by Conversations: the Curve25519 public identity key (32 bytes) without the leading key type byte (0x05) of its serialization in the bundle.
  • OMEMO 2 (urn:xmpp:omemo:2), used by QXmppOmemoManager: the Ed25519 public identity key (32 bytes), as in QXmppOmemoDevice::keyId().

Both are the same key in different representations: the Curve25519 key is the Montgomery form of the Ed25519 key. QXmppUri doesn't convert the keys. To compare a key from a URI of Conversations with an OMEMO 2 key ID, convert the Ed25519 key to its Montgomery form; the other direction is ambiguous because the Curve25519 key lacks the sign bit.

Member Function Documentation

[noexcept default] bool OmemoFingerprint::operator==(const QXmpp::Uri::OmemoFingerprint &) const

Returns true if the two objects are equal (default comparison).

Member Variable Documentation

uint32_t OmemoFingerprint::deviceId

the ID of the OMEMO device, 0 for the legacy format without device ID

QByteArray OmemoFingerprint::keyId

the public identity key of the device, as it is encoded in the URI (not converted)