diff options
author | David Reid <dreid@dreid.org> | 2014-11-17 12:25:55 -0800 |
---|---|---|
committer | David Reid <dreid@dreid.org> | 2014-11-17 12:25:55 -0800 |
commit | 28add4f67de602e0dfc1ff80bce31bc753611103 (patch) | |
tree | c06461c1802652b1b180a62b8e2a1adde9a995e6 | |
parent | 97758a795c3aa3d57d91aec8f674de7b914e4339 (diff) | |
parent | 4b4a1c27b8d4dcf4239493227d1465cd93ec4334 (diff) | |
download | cryptography-28add4f67de602e0dfc1ff80bce31bc753611103.tar.gz cryptography-28add4f67de602e0dfc1ff80bce31bc753611103.tar.bz2 cryptography-28add4f67de602e0dfc1ff80bce31bc753611103.zip |
Merge pull request #1480 from alex/document-in-more-places
Describe teh format of the result of signer.finalize(). Fixes #1479
-rw-r--r-- | docs/hazmat/primitives/asymmetric/dsa.rst | 9 | ||||
-rw-r--r-- | docs/hazmat/primitives/asymmetric/ec.rst | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/docs/hazmat/primitives/asymmetric/dsa.rst b/docs/hazmat/primitives/asymmetric/dsa.rst index 302eea81..43741ede 100644 --- a/docs/hazmat/primitives/asymmetric/dsa.rst +++ b/docs/hazmat/primitives/asymmetric/dsa.rst @@ -79,6 +79,9 @@ provider. >>> signer.update(data) >>> signature = signer.finalize() +The ``signature`` is a ``bytes`` object, whose contents is DER encoded as +described in :rfc:`6979`. + Verification ~~~~~~~~~~~~ @@ -92,6 +95,12 @@ provider. >>> verifier.update(data) >>> verifier.verify() +``verifier()`` takes the signature in the same format as is returned by +``signer.finalize()``. + +``verify()`` will raise an :class:`~cryptography.exceptions.InvalidSignature` +exception if the signature isn't valid. + Numbers ~~~~~~~ diff --git a/docs/hazmat/primitives/asymmetric/ec.rst b/docs/hazmat/primitives/asymmetric/ec.rst index 0e19bb2e..a229fe41 100644 --- a/docs/hazmat/primitives/asymmetric/ec.rst +++ b/docs/hazmat/primitives/asymmetric/ec.rst @@ -52,6 +52,9 @@ Elliptic Curve Signature Algorithms >>> signer.update(b" to sign") >>> signature = signer.finalize() + The ``signature`` is a ``bytes`` object, whose contents is DER encoded as + described in :rfc:`6979`. + .. class:: EllipticCurvePrivateNumbers(private_value, public_numbers) |