def run(self): from sign.Sign import Sign_0_21 from LRSignature.verify.Verify import Verify_0_21 import json rawInput = self.readInput() envelopeList = self.parseInput(rawInput) if self.args.mode == "sign": self.signtool = Sign_0_21( privateKeyID=self.args.key, passphrase=self.args.passphrase, gnupgHome=self.args.gnupghome, gpgbin=self.args.gpgbin, publicKeyLocations=self.args.key_location) is_test_data_opt = self.args.lr_test_data.lower() in [ "true", "yes", "t", "y" ] signedList = self.signEnvelopes(envelopeList, is_test_data=is_test_data_opt) if self.args.publish_url != None: self.publishEnvelopes(signedList) else: print json.dumps({"documents": signedList}) elif self.args.mode == "verify": self.verifytool = Verify_0_21(gpgbin=self.args.gpgbin, gnupgHome=self.args.gnupghome) resultList = self.validateEnvelopes(envelopeList) print json.dumps({"results": resultList})