Skip to content
Snippets Groups Projects
Commit af424262 authored by Donald Stufft's avatar Donald Stufft
Browse files

Merge pull request #46 from dstufft/fix-code-block

Use code-block
parents ec5ad83a fa507b4a
No related branches found
No related tags found
No related merge requests found
...@@ -7,13 +7,13 @@ are typically passed as a keyword argument `encoder` to various methods. ...@@ -7,13 +7,13 @@ are typically passed as a keyword argument `encoder` to various methods.
For example you can generate a signing key and encode it in hex with: For example you can generate a signing key and encode it in hex with:
.. code:: python .. code-block:: python
hex_key = nacl.signing.SigningKey.generate().encode(encoder=nacl.encoding.HexEncoder) hex_key = nacl.signing.SigningKey.generate().encode(encoder=nacl.encoding.HexEncoder)
Then you can later decode it from hex: Then you can later decode it from hex:
.. code:: python .. code-block:: python
signing_key = nacl.signing.SigningKey(hex_key, encoder=nacl.encoding.HexEncoder) signing_key = nacl.signing.SigningKey(hex_key, encoder=nacl.encoding.HexEncoder)
...@@ -43,7 +43,7 @@ Defining your own Encoder ...@@ -43,7 +43,7 @@ Defining your own Encoder
Defining your own encoder is easy. Each encoder is simply a class with 2 static Defining your own encoder is easy. Each encoder is simply a class with 2 static
methods. For example here is the hex encoder: methods. For example here is the hex encoder:
.. code:: python .. code-block:: python
import binascii import binascii
......
...@@ -37,7 +37,7 @@ generated from both pairing of keys, so given two keypairs belonging to alice ...@@ -37,7 +37,7 @@ generated from both pairing of keys, so given two keypairs belonging to alice
(pkalice, skalice) and bob(pkbob, skbob), the key derived from (pkalice, skbob) (pkalice, skalice) and bob(pkbob, skbob), the key derived from (pkalice, skbob)
with equal that from (pkbob, skalice). This is how the system works: with equal that from (pkbob, skalice). This is how the system works:
.. code:: python .. code-block:: python
import nacl.utils import nacl.utils
from nacl.public import PrivateKey, Box from nacl.public import PrivateKey, Box
......
...@@ -13,7 +13,7 @@ other than the length. ...@@ -13,7 +13,7 @@ other than the length.
Example Example
------- -------
.. code:: python .. code-block:: python
import nacl.secret import nacl.secret
import nacl.utils import nacl.utils
......
...@@ -17,7 +17,7 @@ Example ...@@ -17,7 +17,7 @@ Example
Signer's perspective (:class:`~nacl.signing.SigningKey`) Signer's perspective (:class:`~nacl.signing.SigningKey`)
.. code:: python .. code-block:: python
import nacl.encoding import nacl.encoding
import nacl.signing import nacl.signing
...@@ -36,7 +36,7 @@ Signer's perspective (:class:`~nacl.signing.SigningKey`) ...@@ -36,7 +36,7 @@ Signer's perspective (:class:`~nacl.signing.SigningKey`)
Verifier's perspective (:class:`~nacl.signing.VerifyKey`) Verifier's perspective (:class:`~nacl.signing.VerifyKey`)
.. code:: python .. code-block:: python
import nacl.signing import nacl.signing
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment