Beispiel #1
0
 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"),
         )
Beispiel #2
0
 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"),
         )
Beispiel #3
0
 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'))
Beispiel #4
0
 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))
Beispiel #5
0
 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))