2 Slixmpp: The Slick XMPP Library
3 Copyright (C) 2012 Nathanael C. Fritz, Lance J.T. Stout
4 This file is part of Slixmpp.
6 See the file LICENSE for copying permission.
9 from slixmpp
.xmlstream
import ElementBase
12 class Signed(ElementBase
):
14 namespace
= 'jabber:x:signed'
15 plugin_attrib
= 'signed'
16 interfaces
= set(['signed'])
19 def set_signed(self
, value
):
20 parent
= self
.parent()
22 data
= xmpp
['xep_0027'].sign(value
, parent
['from'])
32 class Encrypted(ElementBase
):
34 namespace
= 'jabber:x:encrypted'
35 plugin_attrib
= 'encrypted'
36 interfaces
= set(['encrypted'])
39 def set_encrypted(self
, value
):
40 parent
= self
.parent()
42 data
= xmpp
['xep_0027'].encrypt(value
, parent
['to'])
46 del parent
['encrypted']
48 def get_encrypted(self
):
49 parent
= self
.parent()
52 return xmpp
['xep_0027'].decrypt(self
.xml
.text
, parent
['to'])