aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat/primitives/asymmetric/ec.rst
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-03-05 21:01:16 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-03-08 15:50:17 -0500
commit419615b0cf02d3763b7da208d7118b39e5f25a3b (patch)
treef4e0eeacb33dfa03ad734c4aa2c8e6222edf59df /docs/hazmat/primitives/asymmetric/ec.rst
parent88e7ed6415ccf7fb2432b90876deefa8ab88cc98 (diff)
downloadcryptography-419615b0cf02d3763b7da208d7118b39e5f25a3b.tar.gz
cryptography-419615b0cf02d3763b7da208d7118b39e5f25a3b.tar.bz2
cryptography-419615b0cf02d3763b7da208d7118b39e5f25a3b.zip
serialize EC public keys
Diffstat (limited to 'docs/hazmat/primitives/asymmetric/ec.rst')
-rw-r--r--docs/hazmat/primitives/asymmetric/ec.rst30
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/hazmat/primitives/asymmetric/ec.rst b/docs/hazmat/primitives/asymmetric/ec.rst
index 256c1832..6c03d773 100644
--- a/docs/hazmat/primitives/asymmetric/ec.rst
+++ b/docs/hazmat/primitives/asymmetric/ec.rst
@@ -405,6 +405,36 @@ Key Interfaces
:returns: An :class:`EllipticCurvePublicNumbers` instance.
+.. class:: EllipticCurvePublicKeyWithSerialization
+
+ .. versionadded:: 0.6
+
+ Extends :class:`EllipticCurvePublicKey`.
+
+ .. method:: public_numbers()
+
+ Create a :class:`EllipticCurvePublicNumbers` object.
+
+ :returns: An :class:`EllipticCurvePublicNumbers` instance.
+
+ .. method:: public_bytes(encoding, format)
+
+ Allows serialization of the key to bytes. Encoding (
+ :attr:`~cryptography.hazmat.primitives.serialization.Encoding.PEM` or
+ :attr:`~cryptography.hazmat.primitives.serialization.Encoding.DER`) and
+ format (
+ :attr:`~cryptography.hazmat.primitives.serialization.PublicFormat.SubjectPublicKeyInfo`)
+ are chosen to define the exact serialization.
+
+ :param encoding: A value from the
+ :class:`~cryptography.hazmat.primitives.serialization.Encoding` enum.
+
+ :param format: A value from the
+ :class:`~cryptography.hazmat.primitives.serialization.PublicFormat` enum.
+
+ :return bytes: Serialized key.
+
+
.. _`FIPS 186-3`: http://csrc.nist.gov/publications/fips/fips186-3/fips_186-3.pdf
.. _`FIPS 186-4`: http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf
.. _`some concern`: https://crypto.stackexchange.com/questions/10263/should-we-trust-the-nist-recommended-ecc-parameters