code: public OpenPgpMetadata addOxMessage(Message message, Set<OpenPgpContact> contacts, List<ExtensionElement> payload)
              throws SmackException.NotLoggedInException, IOException, PGPException {
  
          HashSet<OpenPgpContact> recipients = new HashSet<>(contacts);
          OpenPgpContact self = openPgpManager.getOpenPgpSelf();
          recipients.add(self);
  
          OpenPgpElementAndMetadata openPgpElementAndMetadata = signAndEncrypt(recipients, payload);
          message.addExtension(openPgpElementAndMetadata.getElement());
  
          // Set hints on message
          ExplicitMessageEncryptionElement.set(message,
                  ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol.openpgpV0);
          StoreHint.set(message);
          setOXBodyHint(message);
  
          return openPgpElementAndMetadata.getMetadata();
      }
docs: Add an OX-IM message element to a message.
  
  @param message message
  @param contacts recipients of the message
  @param payload payload which will be encrypted and signed
  
  @return metadata about the messages encryption + signatures.
  
  @throws SmackException.NotLoggedInException in case we are not logged in
  @throws PGPException in case something goes wrong during encryption
  @throws IOException IO is dangerous (we need to read keys)