Lines Matching refs:pkcs1
22 from rsa import pkcs1
34 encrypted = pkcs1.encrypt(message, self.pub)
37 decrypted = pkcs1.decrypt(encrypted, self.priv)
44 encrypted = pkcs1.encrypt(message, self.pub)
53 self.assertRaises(pkcs1.DecryptionError, pkcs1.decrypt, encrypted,
62 encrypted1 = pkcs1.encrypt(message, self.pub)
63 encrypted2 = pkcs1.encrypt(message, self.pub)
102 signature = pkcs1.sign(message, self.priv, 'SHA-256')
103 self.assertEqual('SHA-256', pkcs1.verify(message, signature, self.pub))
111 signature = pkcs1.sign(message, self.priv, 'SHA3-256')
112 self.assertEqual('SHA3-256', pkcs1.verify(message, signature, self.pub))
118 signature = pkcs1.sign(message, self.priv, 'SHA-256')
120 self.assertEqual('SHA-256', pkcs1.find_signature_hash(signature, self.pub))
125 signature = pkcs1.sign(b'je moeder', self.priv, 'SHA-256')
126 self.assertRaises(pkcs1.VerificationError, pkcs1.verify,
135 signature = pkcs1.sign(message, self.priv, 'SHA-256')
136 self.assertRaises(pkcs1.VerificationError, pkcs1.verify,
143 signature1 = pkcs1.sign(message, self.priv, 'SHA-1')
144 signature2 = pkcs1.sign(message, self.priv, 'SHA-1')
152 msg_hash = pkcs1.compute_hash(message, 'SHA-256')
153 signature1 = pkcs1.sign_hash(msg_hash, self.priv, 'SHA-256')
156 signature2 = pkcs1.sign(message, self.priv, 'SHA-256')
164 msg_hash = pkcs1.compute_hash(message, 'SHA-224')
165 signature = pkcs1.sign_hash(msg_hash, self.priv, 'SHA-224')
167 self.assertTrue(pkcs1.verify(message, signature, self.pub))
173 signature = pkcs1.sign(message, self.priv, 'SHA-256')
176 pkcs1.verify(message, signature, self.pub)
182 signature = pkcs1.sign(message, self.priv, 'SHA-256')
185 pkcs1.verify(message, signature, self.pub)