XEP-0027: Current Jabber OpenPGP Usage#

class slixmpp.plugins.xep_0027.XEP_0027(xmpp, config=None)[source]#

XEP-0027: Current Jabber OpenPGP Usage

del_keyid(jid=None)[source]#

Delete a keyid.

Changed in version 1.8.0: This function now returns a Future.

Return type

Future

get_keyid(jid=None)[source]#

Get a keyid for a jid.

Changed in version 1.8.0: This function now returns a Future.

Return type

Future

get_keyids()[source]#

Get stored keyids.

Changed in version 1.8.0: This function now returns a Future.

Return type

Future

set_keyid(jid=None, keyid=None)[source]#

Set a keyid for a specific JID.

Changed in version 1.8.0: This function now returns a Future.

Return type

Future

Internal API methods#

The default API here is managing a JID→Keyid dict in-memory.

get_keyid#
  • jid: JID to get.

  • node: unused

  • ifrom: unused

  • args: unused

  • returns: Optional[str], the keyid or None

Get the KeyiD for a JID, None if it is not found.

set_keyid#
  • jid: JID to set the id for.

  • node: unused

  • ifrom: unused

  • args: str, keyid to set

Set the KeyiD for a JID.

del_keyid#
  • jid: JID to delete from the mapping.

  • node: unused

  • ifrom: unused

  • args: unused

Delete the KeyiD for a JID.

get_keyids#
  • jid: unused

  • node: unused

  • ifrom: unused

  • args: unused

  • returns: Dict[JID, str] the full internal mapping

Get all currently stored KeyIDs.

Stanza elements#

class slixmpp.plugins.xep_0027.stanza.Encrypted(xml=None, parent=None)[source]#
get_encrypted()[source]#
interfaces: ClassVar[Set[str]] = {'encrypted'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

is_extension: ClassVar[bool] = True#

If you need to add a new interface to an existing stanza, you can create a plugin and set is_extension = True. Be sure to set the plugin_attrib value to the desired interface name, and that it is the only interface listed in interfaces. Requests for the new interface from the parent stanza will be passed to the plugin directly.

New in version 1.0-Beta5.

iterables: List[ElementBase]#

A list of child stanzas whose class is included in plugin_iterables.

loaded_plugins: Set[str]#
name: ClassVar[str] = 'x'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'jabber:x:encrypted'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

parent: Optional[ReferenceType[ElementBase]]#

A weakref.weakref to the parent stanza, if there is one. If not, then parent is None.

plugin_attrib: ClassVar[str] = 'encrypted'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
plugins: Dict[Tuple[str, Optional[str]], ElementBase]#

An ordered dictionary of plugin stanzas, mapped by their plugin_attrib value.

set_encrypted(value)[source]#
tag: str#

The name of the tag for the stanza’s root element. It is the same as calling tag_name() and is formatted as '{namespace}elementname'.

xml: ET.Element#

The underlying XML object for the stanza. It is a standard xml.etree.ElementTree object.

class slixmpp.plugins.xep_0027.stanza.Signed(xml=None, parent=None)[source]#
get_signed()[source]#
interfaces: ClassVar[Set[str]] = {'signed'}#

The set of keys that the stanza provides for accessing and manipulating the underlying XML object. This set may be augmented with the plugin_attrib value of any registered stanza plugins.

is_extension: ClassVar[bool] = True#

If you need to add a new interface to an existing stanza, you can create a plugin and set is_extension = True. Be sure to set the plugin_attrib value to the desired interface name, and that it is the only interface listed in interfaces. Requests for the new interface from the parent stanza will be passed to the plugin directly.

New in version 1.0-Beta5.

iterables: List[ElementBase]#

A list of child stanzas whose class is included in plugin_iterables.

loaded_plugins: Set[str]#
name: ClassVar[str] = 'x'#

The XML tag name of the element, not including any namespace prefixes. For example, an ElementBase object for <message /> would use name = 'message'.

namespace: str = 'jabber:x:signed'#

The XML namespace for the element. Given <foo xmlns="bar" />, then namespace = "bar" should be used. The default namespace is jabber:client since this is being used in an XMPP library.

parent: Optional[ReferenceType[ElementBase]]#

A weakref.weakref to the parent stanza, if there is one. If not, then parent is None.

plugin_attrib: ClassVar[str] = 'signed'#

For ElementBase subclasses which are intended to be used as plugins, the plugin_attrib value defines the plugin name. Plugins may be accessed by using the plugin_attrib value as the interface. An example using plugin_attrib = 'foo':

register_stanza_plugin(Message, FooPlugin)
msg = Message()
msg['foo']['an_interface_from_the_foo_plugin']
plugins: Dict[Tuple[str, Optional[str]], ElementBase]#

An ordered dictionary of plugin stanzas, mapped by their plugin_attrib value.

set_signed(value)[source]#
tag: str#

The name of the tag for the stanza’s root element. It is the same as calling tag_name() and is formatted as '{namespace}elementname'.

xml: ET.Element#

The underlying XML object for the stanza. It is a standard xml.etree.ElementTree object.