示例#1
0
文件: api.py 项目: farin/gopay4django
 def verify_signature(self, signature1, signature2):
     crypt = GoCrypt()
     # print "My ph1", signature1
     # print "Go ph1", signature2
     signature1 = crypt.decrypt_pydes(signature1)
     signature2 = crypt.decrypt_pydes(signature2)
     # print "My ph2", signature1
     # print "Go ph2", signature2
     if signature1 != signature2:
         raise GoPayException("Error: signatures dont't match")
     return True
示例#2
0
 def verify_signature(self, signature1, signature2):
     crypt = GoCrypt()
     #print "My ph1", signature1
     #print "Go ph1", signature2
     signature1 = crypt.decrypt_pydes(signature1)
     signature2 = crypt.decrypt_pydes(signature2)
     #print "My ph2", signature1
     #print "Go ph2", signature2
     if signature1 != signature2:
         raise GoPayException("Error: signatures dont't match")
     return True
示例#3
0
文件: api.py 项目: farin/gopay4django
 def _create_signature(self, parms, encoded=True):
     long_string = "|".join(parms)
     gocrypt = GoCrypt()
     # print "Long string:".ljust(25), long_string
     # print "Hash:".ljust(25), gocrypt.hash(long_string)
     # print "Encrypted hash:".ljust(25), gocrypt.encrypt_pydes(long_string)
     if encoded:
         signature = gocrypt.encrypt_pydes(long_string)
     else:
         signature = gocrypt.hash(long_string)
     return signature
示例#4
0
 def _create_signature(self, parms, encoded=True):
     long_string = "|".join(parms)
     gocrypt = GoCrypt()
     #print "Long string:".ljust(25), long_string
     #print "Hash:".ljust(25), gocrypt.hash(long_string)
     #print "Encrypted hash:".ljust(25), gocrypt.encrypt_pydes(long_string)
     if encoded:
         signature = gocrypt.encrypt_pydes(long_string)
     else:
         signature = gocrypt.hash(long_string)
     return signature