diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-03-05 21:17:45 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-03-08 17:25:28 -0500 |
commit | a5515c7cdd535b0a2d09ac472c4bb4758491cf4e (patch) | |
tree | d432e69a52c41986a1d447bb7c19ffe9dfb34b60 /docs/hazmat | |
parent | 785cb422767cb7a99fa71d28e2e2e13b16f35c90 (diff) | |
download | cryptography-a5515c7cdd535b0a2d09ac472c4bb4758491cf4e.tar.gz cryptography-a5515c7cdd535b0a2d09ac472c4bb4758491cf4e.tar.bz2 cryptography-a5515c7cdd535b0a2d09ac472c4bb4758491cf4e.zip |
DSA public key serialization
Diffstat (limited to 'docs/hazmat')
-rw-r--r-- | docs/hazmat/primitives/asymmetric/dsa.rst | 33 | ||||
-rw-r--r-- | docs/hazmat/primitives/asymmetric/serialization.rst | 6 |
2 files changed, 37 insertions, 2 deletions
diff --git a/docs/hazmat/primitives/asymmetric/dsa.rst b/docs/hazmat/primitives/asymmetric/dsa.rst index bd02423f..3c3567be 100644 --- a/docs/hazmat/primitives/asymmetric/dsa.rst +++ b/docs/hazmat/primitives/asymmetric/dsa.rst @@ -401,6 +401,39 @@ Key interfaces :class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAPublicNumbers` instance. +.. class:: DSAPublicKeyWithSerialization + + .. versionadded:: 0.8 + + Extends :class:`DSAPublicKey`. + + .. method:: public_numbers() + + Create a + :class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAPublicNumbers` + object. + + :returns: A + :class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAPublicNumbers` + 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. + .. _`DSA`: https://en.wikipedia.org/wiki/Digital_Signature_Algorithm .. _`public-key`: https://en.wikipedia.org/wiki/Public-key_cryptography diff --git a/docs/hazmat/primitives/asymmetric/serialization.rst b/docs/hazmat/primitives/asymmetric/serialization.rst index ff69973a..7839f346 100644 --- a/docs/hazmat/primitives/asymmetric/serialization.rst +++ b/docs/hazmat/primitives/asymmetric/serialization.rst @@ -316,8 +316,10 @@ Serialization Formats An enumeration for public key formats. Used with the ``public_bytes`` method available on :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKeyWithSerialization` - and - :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKeyWithSerialization`. + , + :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKeyWithSerialization` + , and + :class:`~cryptography.hazmat.primitives.asymmetric.dsa.DSAPublicKeyWithSerialization`. .. attribute:: SubjectPublicKeyInfo |