aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2016-03-27 17:00:59 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2016-03-27 17:00:59 -0400
commit01c704992dd6b4bcb04c9760aa2a024979ef6d13 (patch)
treebb4989e614b50fc0cad244fbaac04ca8d28e59a3 /src
parentbeb25516644666c058d6d4ee83a87148a06e78d0 (diff)
downloadcryptography-01c704992dd6b4bcb04c9760aa2a024979ef6d13.tar.gz
cryptography-01c704992dd6b4bcb04c9760aa2a024979ef6d13.tar.bz2
cryptography-01c704992dd6b4bcb04c9760aa2a024979ef6d13.zip
Added a special case for EC as well
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/x509/extensions.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cryptography/x509/extensions.py b/src/cryptography/x509/extensions.py
index b3c007cd..b7ea72cd 100644
--- a/src/cryptography/x509/extensions.py
+++ b/src/cryptography/x509/extensions.py
@@ -17,6 +17,7 @@ import six
from cryptography import utils
from cryptography.hazmat.primitives import constant_time, serialization
+from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurvePublicKey
from cryptography.hazmat.primitives.asymmetric.rsa import RSAPublicKey
from cryptography.x509.general_name import GeneralName, IPAddress, OtherName
from cryptography.x509.name import Name
@@ -38,6 +39,8 @@ def _key_identifier_from_public_key(public_key):
serialization.Encoding.DER,
serialization.PublicFormat.PKCS1,
)
+ elif isinstance(public_key, EllipticCurvePublicKey):
+ data = public_key.public_numbers().encode_point()
else:
# This is a very slow way to do this.
serialized = public_key.public_bytes(