-
-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allows an x509.Name to be hashable if it contains unique_identifier
Fixes #268
- Loading branch information
Showing
2 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -485,6 +485,23 @@ def test_build_name_type_by_oid(self): | |
self.assertEqual("unique_identifier", complex_name.chosen[3][0]['type'].native) | ||
self.assertIsInstance(complex_name.chosen[3][0]['value'], core.OctetBitString) | ||
|
||
def test_name_hashable(self): | ||
complex_name = x509.Name.build( | ||
{ | ||
'country_name': 'US', | ||
'tpm_manufacturer': 'Acme Co', | ||
'unique_identifier': b'\x04\x10\x03\x09', | ||
'email_address': '[email protected]' | ||
} | ||
) | ||
self.assertEqual( | ||
"country_name: us \x1e" | ||
"email_address: [email protected] \x1e" | ||
"tpm_manufacturer: acme co \x1e" | ||
"unique_identifier: \x04\x10\x03\x09 ", | ||
complex_name.hashable | ||
) | ||
|
||
def test_v1_cert(self): | ||
cert = self._load_cert('chromium/ndn.ca.crt') | ||
tbs_cert = cert['tbs_certificate'] | ||
|