def pack(self, req, receiver='<STR_LIT>', iss='<STR_LIT>', lifetime=<NUM_LIT:0>, sign=True,<EOL>sign_alg='<STR_LIT>', encrypt=False, enc_enc="<STR_LIT>",<EOL>enc_alg="<STR_LIT>", aud=None):
if not iss:<EOL><INDENT>iss = self.iss<EOL><DEDENT>if not lifetime:<EOL><INDENT>lifetime = self.lifetime<EOL><DEDENT>keyjar = self.keyjar<EOL>_metadata = copy.deepcopy(req)<EOL>if self.add_ons:<EOL><INDENT>_metadata.update(self.add_ons)<EOL><DEDENT>args = {}<EOL>if sign:<EOL><INDENT>if sign_alg:<EOL><INDENT>args['<STR_LIT>'] = sign_alg<EOL><DEDENT>else:<EOL><INDENT>args['<STR_LIT>'] = self.alg<EOL><DEDENT><DEDENT>if encrypt:<EOL><INDENT>args['<STR_LIT>'] = enc_enc<EOL>args['<STR_LIT>'] = enc_alg<EOL><DEDENT>_jwt = JWT(keyjar, iss=iss, msg_cls=_metadata.__class__,<EOL>lifetime=lifetime, **args)<EOL>if iss in keyjar.issuer_keys:<EOL><INDENT>owner = iss<EOL><DEDENT>else:<EOL><INDENT>owner = '<STR_LIT>'<EOL><DEDENT>return _jwt.pack(payload=_metadata.to_dict(), owner=owner,<EOL>recv=receiver, aud=aud)<EOL>
:param req: Original metadata statement as a 
    :py:class:`MetadataStatement` instance
:param receiver: The immediate receiver of the JWS
:param iss:
:param lifetime:
:param sign:
:param sign_alg:
:param encrypt:
:param enc_alg:
:param enc_enc:
:param aud: The audience, a list of receivers.
:return: A dictionary with a signed JWT as value with the key 'sms'