Hi Gilbert, I initially searched for a codec solution but this seems more like a string formating exercise. Here is my short solution:
> cert = x509.load_pem_x509_certificate(pem_block, default_backend()) > > hash_bytes = cert.fingerprint(hashes.SHA1()) > print(hash_bytes) > b'v\xe1\x81\x9f\xad\xf0jU\xefK\x12j.\xf7C\xc2\xba\xe8\xa1Q' hash = ":".join([hex(h)[2:].upper() for h in hash_bytes]) print(hash) '76:E1:81:9F:AD:F0:6A:55:EF:4B:12:6A:2E:F7:43:C2:BA:E8:A1:51' Regards Alexander _______________________________________________ Cryptography-dev mailing list Cryptography-dev@python.org https://mail.python.org/mailman/listinfo/cryptography-dev