'Wrap `JSONDeSerializable` object in JWS.
.. todo:: Implement ``acmePath``.
:param .JSONDeSerializable obj:
:param bytes nonce:
:rtype: `.JWS`'

def _wrap_in_jws(self, obj, nonce):

    jobj = obj.json_dumps(indent=2).encode()
    logger.debug('JWS    payload:\n%s', jobj)
    return jws.JWS.sign(payload=jobj, key=self.key, alg=self.alg, nonce=nonce).json_dumps(indent=2)
