Beispiel #1
0
    def test_merge_key_usage(self):
        key_usage = self._build_key_usage(critical=True)

        self.assertEqual(key_usage,
                         v._merge_key_usage(key_usage,
                                            ['Digital Signature',
                                             'Key Encipherment']))
Beispiel #2
0
    def test_merge_key_usage_disallowed_but_not_critical(self):
        key_usage = self._build_key_usage()
        expected = c_x509.KeyUsage(
            True, False, False, False, False, False, False, False, False)
        expected = c_x509.Extension(expected.oid, False, expected)

        self.assertEqual(v._merge_key_usage(
            key_usage, ['Digital Signature']), expected)
Beispiel #3
0
    def test_merge_key_usage_disallowed(self):
        key_usage = self._build_key_usage(critical=True)

        with self.assertRaises(CertificateValidationError):
            v._merge_key_usage(key_usage, ['Digital Signature'])