def test_sign_message_with_passphrase(self): key = RSA.importKey(PRIVKEY_DATA) with patch("salt.crypt.get_rsa_key", return_value=key): self.assertEqual( SIG, crypt.sign_message("/keydir/keyname.pem", MSG, passphrase="password"), )
def test_sign_message_with_passphrase(self): key = M2Crypto.RSA.load_key_string(six.b(PRIVKEY_DATA)) with patch("salt.crypt.get_rsa_key", return_value=key): self.assertEqual( SIG, crypt.sign_message("/keydir/keyname.pem", MSG, passphrase="password"), )
def test_sign_message_with_passphrase(self): key = RSA.importKey(PRIVKEY_DATA) with patch('salt.crypt._get_rsa_key', return_value=key): self.assertEqual( SIG, crypt.sign_message('/keydir/keyname.pem', MSG, passphrase='password'))
def test_sign_message(self): with patch('salt.utils.fopen', mock_open(read_data=PRIVKEY_DATA)): self.assertEqual(SIG, crypt.sign_message('/keydir/keyname.pem', MSG))
def test_sign_message(self): with patch('salt.utils.fopen', mock_open(read_data=PRIVKEY_DATA)): self.assertEqual(SIG, crypt.sign_message('/keydir/keyname.pem', MSG))