?¡ëPNG  IHDR ? f ??C1 sRGB ??¨¦ gAMA ¡À? ¨¹a pHYs ? ??o¡§d GIDATx^¨ª¨¹L¡±¡Âe¡ÂY?a?("Bh?_¨°???¡é¡ì?q5k?*:t0A-o??£¤]VkJ¡éM??f?¡À8\k2¨ªll¡ê1]q?¨´???T
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/user1137782/www/china1.by/classwithtostring.php on line 86

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
# pygpgme - a Python wrapper for the gpgme library # Copyright (C) 2006 James Henstridge # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import unittest import os try: from io import BytesIO except ImportError: from StringIO import StringIO as BytesIO from textwrap import dedent import gpgme from gpgme.tests.util import GpgHomeTestCase class PassphraseTestCase(GpgHomeTestCase): import_keys = ['passphrase.pub', 'passphrase.sec'] def test_sign_without_passphrase_cb(self): ctx = gpgme.Context() key = ctx.get_key('EFB052B4230BBBC51914BCBB54DCBBC8DBFB9EB3') ctx.signers = [key] plaintext = BytesIO('Hello World\n') signature = BytesIO() try: new_sigs = ctx.sign(plaintext, signature, gpgme.SIG_MODE_CLEAR) except gpgme.GpgmeError, e: self.assertEqual(e[0], gpgme.ERR_SOURCE_GPGME) self.assertEqual(e[1], gpgme.ERR_BAD_PASSPHRASE) else: self.fail('gpgme.GpgmeError not raised') def passphrase_cb(self, uid_hint, passphrase_info, prev_was_bad, fd): self.uid_hint = uid_hint self.passphrase_info = passphrase_info self.prev_was_bad = prev_was_bad os.write(fd, 'test\n') def test_sign_with_passphrase_cb(self): ctx = gpgme.Context() key = ctx.get_key('EFB052B4230BBBC51914BCBB54DCBBC8DBFB9EB3') ctx.signers = [key] ctx.passphrase_cb = self.passphrase_cb plaintext = BytesIO('Hello World\n') signature = BytesIO() self.uid_hint = None self.passphrase_info = None self.prev_was_bad = None new_sigs = ctx.sign(plaintext, signature, gpgme.SIG_MODE_CLEAR) # ensure that passphrase_cb has been run, and the data it was passed self.assertEqual(self.uid_hint, '54DCBBC8DBFB9EB3 Passphrase (test) ') self.assertEqual(self.passphrase_info, '54DCBBC8DBFB9EB3 54DCBBC8DBFB9EB3 17 0') self.assertEqual(self.prev_was_bad, False) self.assertEqual(new_sigs[0].type, gpgme.SIG_MODE_CLEAR) self.assertEqual(new_sigs[0].fpr, 'EFB052B4230BBBC51914BCBB54DCBBC8DBFB9EB3') def test_suite(): loader = unittest.TestLoader() return loader.loadTestsFromName(__name__)