Exemple #1
0
    def test_load_pem_private_key_with_bytes_private_key(self):
        private_key = self._generate_private_key()
        private_key = self._private_bytes(private_key)

        self.assertIsInstance(private_key, six.binary_type)
        private_key = operations._load_pem_private_key(private_key)
        self.assertIsInstance(private_key, rsa.RSAPrivateKey)
Exemple #2
0
    def test_load_pem_private_key_with_bytes_private_key(self):
        private_key = self._generate_private_key()
        private_key = self._private_bytes(private_key)

        self.assertIsInstance(private_key, six.binary_type)
        private_key = operations._load_pem_private_key(private_key)
        self.assertIsInstance(private_key, rsa.RSAPrivateKey)
Exemple #3
0
    def test_load_pem_private_key_with_unicode_private_key(self):
        private_key = self._generate_private_key()
        private_key = self._private_bytes(private_key)
        private_key = six.text_type(private_key.decode('utf-8'))

        self.assertIsInstance(private_key, six.text_type)
        private_key = operations._load_pem_private_key(private_key)
        self.assertIsInstance(private_key, rsa.RSAPrivateKey)
Exemple #4
0
    def test_load_pem_private_key_with_unicode_private_key(self):
        private_key = self._generate_private_key()
        private_key = self._private_bytes(private_key)
        private_key = six.text_type(private_key.decode('utf-8'))

        self.assertIsInstance(private_key, six.text_type)
        private_key = operations._load_pem_private_key(private_key)
        self.assertIsInstance(private_key, rsa.RSAPrivateKey)