Class ExplicitMessageEncryptionElement

java.lang.Object
org.jivesoftware.smackx.eme.element.ExplicitMessageEncryptionElement
All Implemented Interfaces:
org.jivesoftware.smack.packet.Element, org.jivesoftware.smack.packet.ExtensionElement, org.jivesoftware.smack.packet.NamedElement, org.jivesoftware.smack.packet.XmlElement, org.jivesoftware.smack.packet.XmlLangElement

public class ExplicitMessageEncryptionElement extends Object implements org.jivesoftware.smack.packet.ExtensionElement
  • Field Details

  • Constructor Details

  • Method Details

    • getProtocol

    • getEncryptionNamespace

      public String getEncryptionNamespace()
    • getName

      public String getName()
      Get the optional name of the encryption method.
      Returns:
      the name of the encryption method or null.
    • getElementName

      public String getElementName()
      Specified by:
      getElementName in interface org.jivesoftware.smack.packet.NamedElement
    • getNamespace

      public String getNamespace()
      Specified by:
      getNamespace in interface org.jivesoftware.smack.packet.XmlElement
    • toXML

      public org.jivesoftware.smack.util.XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
      Specified by:
      toXML in interface org.jivesoftware.smack.packet.Element
    • from

      public static ExplicitMessageEncryptionElement from(org.jivesoftware.smack.packet.Message message)
    • hasProtocol

      public static boolean hasProtocol(org.jivesoftware.smack.packet.MessageView message, String protocolNamespace)
      Return true, if the message already contains an EME element with the specified protocolNamespace.
      Parameters:
      message - message
      protocolNamespace - namespace
      Returns:
      true if message has EME element for that namespace, otherwise false
    • hasProtocol

      public static boolean hasProtocol(org.jivesoftware.smack.packet.MessageView message, ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol protocol)
      Return true, if the message already contains an EME element with the specified protocol namespace.
      Parameters:
      message - message
      protocol - protocol
      Returns:
      true if message has EME element for that namespace, otherwise false
    • set

      public static void set(org.jivesoftware.smack.packet.MessageBuilder message, ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol protocol)
      Add an EME element containing the specified protocol namespace to the message. In case there is already an element with that protocol, we do nothing.
      Parameters:
      message - a message builder.
      protocol - encryption protocol