예제 #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"),
         )
예제 #2
0
파일: test_crypt.py 프로젝트: zxstar/salt
 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"),
         )
예제 #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'))
예제 #4
0
파일: test_crypt.py 프로젝트: cldeluna/salt
 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))
예제 #5
0
파일: crypt_test.py 프로젝트: DaveQB/salt
 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))