def _sign(self, message, ts=None):
    logger.debug('signing {0}'.format(message.id))
    message.tags['signature'] = {'origin': self.me, 'ts': (ts or str(datetime.datetime.utcnow()))}
    payload = serialize(message)
    message.tags['signature']['hash'] = base64.b64encode(sign(payload, self.key))
def _sign(self, message, ts=None):
    logger.debug('signing {0}'.format(message.id))
    message.tags['signature'] = {'origin': self.me, 'ts': (ts or str(datetime.datetime.utcnow()))}
    payload = serialize(message)
    message.tags['signature']['hash'] = base64.b64encode(sign(payload, self.key))