aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_x509_ext.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_x509_ext.py')
-rw-r--r--tests/test_x509_ext.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py
index d15d6669..06adaa37 100644
--- a/tests/test_x509_ext.py
+++ b/tests/test_x509_ext.py
@@ -1578,6 +1578,30 @@ class TestRSASubjectAlternativeNameExtension(object):
assert 'Invalid rfc822name value' in str(exc.value)
+ def test_other_name(self, backend):
+ cert = _load_cert(
+ os.path.join(
+ "x509", "custom", "san_other_name.pem"
+ ),
+ x509.load_pem_x509_certificate,
+ backend
+ )
+
+ ext = cert.extensions.get_extension_for_oid(
+ x509.OID_SUBJECT_ALTERNATIVE_NAME
+ )
+ assert ext is not None
+ assert ext.critical is False
+
+ assert len(ext.value) == 1
+ assert list(ext.value)[0] == \
+ x509.OtherName(
+ x509.ObjectIdentifier("1.2.3.4"),
+ b'\x16\x0bHello World')
+
+ othernames = ext.value.get_values_for_type(x509.OtherName)
+ assert othernames == [b'\x16\x0bHello World']
+
@pytest.mark.requires_backend_interface(interface=RSABackend)
@pytest.mark.requires_backend_interface(interface=X509Backend)