Пример #1
0
    def signRequest(self,
                    req: Request,
                    identifier: Identifier = None) -> Request:
        """
        Signs request. Modifies reqId and signature. May modify identifier.

        :param req: request
        :param requestIdStore: request id generator
        :param identifier: signer identifier
        :return: signed request
        """

        idr = self.requiredIdr(idr=identifier or req._identifier)
        # idData = self._getIdData(idr)
        req._identifier = idr
        req.reqId = req.gen_req_id()
        # req.digest = req.getDigest()
        # QUESTION: `self.ids[idr]` would be overwritten if same identifier
        # is used to send 2 requests, why is `IdData` persisted?
        # self.ids[idr] = IdData(idData.signer, req.reqId)
        req.signature = self.signMsg(msg=req.signingState(identifier=idr),
                                     identifier=idr,
                                     otherIdentifier=req.identifier)

        return req
Пример #2
0
    def signRequest(self,
                    req: Request,
                    identifier: Identifier=None) -> Request:
        """
        Signs request. Modifies reqId and signature. May modify identifier.

        :param req: request
        :param requestIdStore: request id generator
        :param identifier: signer identifier
        :return: signed request
        """

        idr = self.requiredIdr(idr=identifier or req._identifier)
        # idData = self._getIdData(idr)
        req._identifier = idr
        req.reqId = req.gen_req_id()
        # req.digest = req.getDigest()
        # QUESTION: `self.ids[idr]` would be overwritten if same identifier
        # is used to send 2 requests, why is `IdData` persisted?
        # self.ids[idr] = IdData(idData.signer, req.reqId)
        req.signature = self.signMsg(msg=req.signingState(identifier=idr),
                                     identifier=idr,
                                     otherIdentifier=req.identifier)

        return req
Пример #3
0
 def do_multi_sig_on_req(self, request: Request, identifier: str):
     idr = self.requiredIdr(idr=identifier)
     signature = self.signMsg(msg=request.signingState(identifier),
                              identifier=idr)
     request.add_signature(idr, signature)
Пример #4
0
 def do_multi_sig_on_req(self, request: Request, identifier: str):
     idr = self.requiredIdr(idr=identifier)
     signature = self.signMsg(msg=request.signingState(identifier),
                              identifier=idr)
     request.add_signature(idr, signature)