XEP-0027: Current Jabber OpenPGP Usage#

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

XEP-0027: Current Jabber OpenPGP Usage

default_config: ClassVar[Dict[str, Any]] = {'gpg_binary': 'gpg', 'gpg_home': '', 'key_server': 'pgp.mit.edu', 'keyring': None, 'use_agent': True}#

The basic, standard configuration for the plugin, which may be overridden when initializing the plugin. The configuration fields included here may be accessed directly as attributes of the plugin. For example, including the configuration field ‘foo’ would mean accessing plugin.foo returns the current value of plugin.config[‘foo’].

del_keyid(jid=None)[source]#

Delete a keyid. :rtype: Future

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

dependencies: ClassVar[Set[str]] = {}#

Some plugins may depend on others in order to function properly. Any plugin names included in dependencies will be initialized as needed if this plugin is enabled.

description: str = 'XEP-0027: Current Jabber OpenPGP Usage'#

A longer name for the plugin, describing its purpose. For example, a plugin for XEP-0030 would use ‘Service Discovery’ as its description value.

get_keyid(jid=None)[source]#

Get a keyid for a jid. :rtype: Future

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

get_keyids()[source]#

Get stored keyids. :rtype: Future

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

name: str = 'xep_0027'#

A short name for the plugin based on the implemented specification. For example, a plugin for XEP-0030 would use ‘xep_0030’.

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

Set a keyid for a specific JID. :rtype: Future

Changed in version 1.8.0: This function now returns a 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.

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.

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']
set_encrypted(value)[source]#
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.

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.

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']
set_signed(value)[source]#