Esempio n. 1
0
def _add_x509_hex(obj):
    if isinstance(obj, list):
        for array_item in obj:
            _add_x509_hex(array_item)
    elif isinstance(obj, dict):
        try:
            if 'x509ThumbprintHex' not in obj:
                if obj['x509Thumbprint']:
                    obj['x509ThumbprintHex'] = b64_to_hex(obj['x509Thumbprint'])
        except (KeyError, IndexError, TypeError):
            pass
        for item_key in obj:
            _add_x509_hex(obj[item_key])
Esempio n. 2
0
def _add_x509_hex(obj):
    if isinstance(obj, list):
        for array_item in obj:
            _add_x509_hex(array_item)
    elif isinstance(obj, dict):
        try:
            if 'x509ThumbprintHex' not in obj:
                if obj['x509Thumbprint']:
                    obj['x509ThumbprintHex'] = b64_to_hex(obj['x509Thumbprint'])
        except (KeyError, IndexError, TypeError):
            pass
        for item_key in obj:
            _add_x509_hex(obj[item_key])
Esempio n. 3
0
 def test_b64_to_hex_type(self):
     self.assertIsInstance(b64_to_hex(self.base64), str)
Esempio n. 4
0
 def test_b64_to_hex(self):
     self.assertEqual('3EF38981A3EAE51D34E06C93D6D074216DD75323',
                      b64_to_hex(self.base64))
Esempio n. 5
0
 def test_b64_to_hex_type(self):
     self.assertIsInstance(b64_to_hex(self.base64), str)
Esempio n. 6
0
 def test_b64_to_hex(self):
     self.assertEquals('3EF38981A3EAE51D34E06C93D6D074216DD75323', b64_to_hex(self.base64))