Exemple #1
0
    def test_signing(self):
        message = 'hello'
        key = RSA.load_key_bio(BIO.MemoryBuffer(RSA_KEY))

        authenticator = Authenticator()
        authenticator.rsa_key = key
        signature = authenticator.sign(message)

        self.assertEqual(signature, key.sign(message))
Exemple #2
0
    def test_signing(self):
        message = 'hello'
        key = RSA.load_key_bio(BIO.MemoryBuffer(RSA_KEY))

        authenticator = Authenticator()
        authenticator.rsa_key = key
        signature = authenticator.sign(message)

        self.assertEqual(signature, key.sign(message))
Exemple #3
0
 def test_signing_not_enabled(self):
     authenticator = Authenticator()
     authenticator.enabled = False
     signature = authenticator.sign('hello')
     self.assertEqual(signature, '')
Exemple #4
0
 def test_signing_not_enabled(self):
     authenticator = Authenticator()
     authenticator.enabled = False
     signature = authenticator.sign('hello')
     self.assertEqual(signature, '')