Beispiel #1
0
 def setupEncryption(self, certData):
     if certData:
         cert = crypto.loadCertificate(certData)
     else:
         cert = self.createCertificate()
     self.myCertificate = cert
     self.tubID = crypto.digest32(cert.digest("sha1"))
Beispiel #2
0
 def setupEncryption(self, certData):
     if certData:
         cert = crypto.loadCertificate(certData)
     else:
         cert = self.createCertificate()
     self.myCertificate = cert
     self.tubID = crypto.digest32(cert.digest("sha1"))
Beispiel #3
0
 def setupEncryption(self, certData):
     if certData:
         cert = crypto.loadCertificate(certData)
     else:
         cert = self.createCertificate()
     self.myCertificate = cert
     self.tubID = crypto.digest32(cert.digest('sha1')).decode('ascii')
Beispiel #4
0
 def setupEncryption(self, certData):
     if not crypto_available:
         raise RuntimeError("crypto for PB is not available, "
                            "try importing foolscap.crypto and see "
                            "what happens")
     if certData:
         cert = crypto.PrivateCertificate.loadPEM(certData)
     else:
         cert = self.createCertificate()
     self.myCertificate = cert
     self.tubID = crypto.digest32(cert.digest("sha1"))
Beispiel #5
0
 def setupEncryption(self, certData):
     if not crypto_available:
         raise RuntimeError("crypto for PB is not available, "
                            "try importing foolscap.crypto and see "
                            "what happens")
     if certData:
         cert = crypto.PrivateCertificate.loadPEM(certData)
     else:
         cert = self.createCertificate()
     self.myCertificate = cert
     self.tubID = crypto.digest32(cert.digest("sha1"))
Beispiel #6
0
 def test_digest32(self):
     colondigest = b'0F:E6:23:51:58:EA:66:A1:69:52:21:30:01:CA:7D:36:E0:EF:6C:46'
     d32 = crypto.digest32(colondigest)
     self.failUnlessEqual(d32, "b7tcguky5jtkc2kseeyadst5g3qo63cg")