summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-11-27 09:49:31 -1000
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-12-15 15:49:49 -0600
commit0307c37651216793c0cd63ec7e434878d4d8b5c5 (patch)
treeea40b6878c754b412ec28a29a2e5d464c2b7a109
parenta693cfdfb5e55f92f21cd7b2aa52f332679f241f (diff)
downloadcryptography-0307c37651216793c0cd63ec7e434878d4d8b5c5.tar.gz
test x509 fingerprint
-rw-r--r--tests/test_x509.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/test_x509.py b/tests/test_x509.py
index 59b84004e..475558f22 100644
--- a/tests/test_x509.py
+++ b/tests/test_x509.py
@@ -4,6 +4,7 @@
from __future__ import absolute_import, division, print_function
+import binascii
import datetime
import os
@@ -13,7 +14,7 @@ from cryptography import x509
from cryptography.hazmat.backends.interfaces import (
DSABackend, EllipticCurveBackend, RSABackend, X509Backend
)
-from cryptography.hazmat.primitives import interfaces
+from cryptography.hazmat.primitives import hashes, interfaces
from cryptography.hazmat.primitives.asymmetric import ec
from .hazmat.primitives.test_ec import _skip_curve_unsupported
@@ -66,6 +67,8 @@ class TestRSAX509Certificate(object):
public_key = cert.public_key()
assert isinstance(public_key, interfaces.RSAPublicKey)
assert cert.version == x509.X509Version.v3
+ fingerprint = binascii.hexlify(cert.fingerprint(hashes.SHA1()))
+ assert fingerprint == "6f49779533d565e8b7c1062503eab41492c38e4d"
def test_utc_pre_2000_not_before_cert(self, backend):
cert = _load_cert(