diff --git a/lib/src/omemo/bundle.dart b/lib/src/omemo/bundle.dart index 7896a7b..c2da915 100644 --- a/lib/src/omemo/bundle.dart +++ b/lib/src/omemo/bundle.dart @@ -1,5 +1,6 @@ import 'dart:convert'; import 'package:cryptography/cryptography.dart'; +import 'package:hex/hex.dart'; import 'package:omemo_dart/src/keys.dart'; class OmemoBundle { @@ -43,4 +44,10 @@ class OmemoBundle { } List get spkSignature => base64Decode(spkSignatureEncoded); + + /// Calculates the fingerprint of the bundle (See + /// https://xmpp.org/extensions/xep-0384.html#security ยง 2). + Future getFingerprint() async { + return HEX.encode(await ik.getBytes()); + } }