Пример #1
0
    def setUp(self):
        self.randText = ''.join([random.choice(string.letters) for i in range(10)])

        pubPath = os.path.join(basePath, 'config', 'test_key.pub')
        privPath = os.path.join(basePath, 'config', 'test_key')

        if not os.path.isfile(pubPath) or not os.path.isfile(privPath):
            raise SkipTest('could not access RSA keypair in config folder')

        self.rsa = Rsa()
        self.rsa.params['encode']['publicKey'] = pubPath

        self.rsa.params['decode']['privateKey'] = privPath
Пример #2
0
    def setUp(self):
        self.randText = ''.join(
            [random.choice(string.letters) for i in range(10)])

        pubPath = os.path.join(basePath, 'config', 'test_key.pub')
        privPath = os.path.join(basePath, 'config', 'test_key')

        if not os.path.isfile(pubPath) or not os.path.isfile(privPath):
            raise SkipTest('could not access RSA keypair in config folder')

        self.rsa = Rsa()

        # set some parameters
        for e in self.rsa.params['sending']:
            if e.name == 'publicKey':
                e.value = pubPath

        for e in self.rsa.params['receiving']:
            if e.name == 'privateKey':
                e.value = privPath