create static method

SecureMessage create(
  1. InstantMessage iMsg,
  2. Uint8List ciphertext,
  3. Map<ID, EncryptedBundle>? keyBundles
)

Create a SecureMessage from an instant message, adding 'data' and 'keys'.

Encrypts the plaintext content with a symmetric key, then encrypts the key for each receiver terminal, forming the encrypted data and key bundles.

iMsg is the plain instant message. ciphertext is the encrypted data of the content. keyBundles is the encrypted key bundles for the receiver terminals.

Returns a new SecureMessage instance.

Implementation

static SecureMessage create(InstantMessage iMsg, Uint8List ciphertext, Map<ID, EncryptedBundle>? keyBundles) {
  final helper = sharedMessageExtensions.secureHelper;
  return helper!.createSecureMessage(iMsg, ciphertext, keyBundles);
}