Key sync will be triggered after Keygen, and when CannotDecrypt.

Considerations to take in account:

  1. Implement callbacks
    1. MessageToSend(Message):
      • The message to send, has to be sent by the app as it is (as if pEp were disabled, don’t encrypt it, etc.)
      • pEp-auto-consume header (Optional field) should be present (if not, the keysync will not get triggered)
    2. ShowHandshake(Identity myself, Identity partner): Triggers Device Group dialog (https://cacert.pep.foundation/jira/projects/ENGINE/issues/ENGINE-117)
  2. SyncSession (or Session/Engine instance) should be the very first one.
    1. Instantiate session
    2. Set both Callbacks
    3. Call Engine.startSync()
  3. After decrypt
    1. if (pEpStatus = pEpMessageConsumed (0xff02) DELETE IT
    2. if (pEpStatus = pEpMessageDiscarded (0xff03) IGNORE IT