def sign(self, envelope):
        '''
        Hashes and Signs a LR envelope according to the version 2.0 LR Specification
        '''
        if self._version_check(envelope) or self.sign_everything:
            msg = self.get_message(envelope)
            
            signPrefs = {
                         "keyid": self.privateKeyID,
                         "passphrase": self.passphrase,
                         "clearsign": True 
                    }
            
            result = self.gpg.sign(msg, **signPrefs)
            
            
            envelope["digital_signature"] = self._get_sig_block(result.data)
        
        return envelope
dataset/ETHPy150Open jimklo/LRSignature/src/LRSignature/sign/Sign.py/Sign_0_21.sign/original