From f22f61234470bd5c86c80ae409b2698d2a2da1a5 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 5 Aug 2015 12:57:13 +0100 Subject: add SubjectKeyIdentifier.create_from_public_key --- docs/x509/reference.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'docs') diff --git a/docs/x509/reference.rst b/docs/x509/reference.rst index 61971fed..2ccc5272 100644 --- a/docs/x509/reference.rst +++ b/docs/x509/reference.rst @@ -1119,6 +1119,21 @@ X.509 Extensions The binary value of the identifier. + .. classmethod:: create_from_public_key(public_key) + + .. versionadded:: 1.0 + + Creates a new SubjectKeyIdentifier instance using the public key + provided to generate the appropriate digest. This should be the public + key that is in the certificate. + + :param public_key: One of + :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey` + , + :class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAPublicKey` + , or + :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKey`. + .. class:: SubjectAlternativeName .. versionadded:: 0.9 -- cgit v1.2.3 From d4a7f062d7dc9330fb701086dd06ac81a5b1e3d5 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 5 Aug 2015 18:32:18 +0100 Subject: rename to classmethod to from_public_key --- docs/x509/reference.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/x509/reference.rst b/docs/x509/reference.rst index 2ccc5272..61f73e9d 100644 --- a/docs/x509/reference.rst +++ b/docs/x509/reference.rst @@ -1119,7 +1119,7 @@ X.509 Extensions The binary value of the identifier. - .. classmethod:: create_from_public_key(public_key) + .. classmethod:: from_public_key(public_key) .. versionadded:: 1.0 -- cgit v1.2.3 From eb9ec00ff857e2788938baa50beb9c92e2b693db Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sat, 8 Aug 2015 10:03:02 -0500 Subject: add more prose about how the digest is generated --- docs/x509/reference.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/x509/reference.rst b/docs/x509/reference.rst index 61f73e9d..e83a4ace 100644 --- a/docs/x509/reference.rst +++ b/docs/x509/reference.rst @@ -1125,7 +1125,9 @@ X.509 Extensions Creates a new SubjectKeyIdentifier instance using the public key provided to generate the appropriate digest. This should be the public - key that is in the certificate. + key that is in the certificate. The generated digest is the SHA1 hash + of the ``subjectPublicKey`` ASN.1 bit string. This is the first + recommendation in :rfc:`5280` section 4.2.1.2. :param public_key: One of :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey` -- cgit v1.2.3