Files
wolfssl/wrapper/python/README.rst

110 lines
2.4 KiB
ReStructuredText
Raw Normal View History

2016-05-03 00:41:54 -03:00
2016-04-28 13:20:10 -03:00
wolfcrypt: the wolfSSL Crypto Engine
====================================
2016-05-09 18:46:01 -03:00
**wolfCrypt Python**, a.k.a. ``wolfcrypt`` is a Python library that encapsulates
**wolfSSL's wolfCrypt API**.
2016-04-28 13:20:10 -03:00
2016-05-09 18:46:01 -03:00
**wolfCrypt** is a lightweight, portable, C-language-based crypto library
targeted at IoT, embedded, and RTOS environments primarily because of its size,
speed, and feature set. It works seamlessly in desktop, enterprise, and cloud
environments as well.
2016-04-28 13:20:10 -03:00
2016-05-09 18:46:01 -03:00
Installation
------------
2016-04-28 13:20:10 -03:00
2016-05-16 21:55:31 -03:00
Dependencies
~~~~~~~~~~~~
2016-05-09 18:46:01 -03:00
2016-05-16 21:55:31 -03:00
Before installing ``wolfcrypt``, make sure you have ``wolfssl`` C library
installed in your machine:
2016-05-09 18:46:01 -03:00
.. code-block:: console
2016-04-28 13:20:10 -03:00
2016-04-28 13:36:41 -03:00
$ git clone git@github.com:wolfssl/wolfssl.git
$ cd wolfssl
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
2016-04-28 13:20:10 -03:00
2016-05-16 21:55:31 -03:00
**Linux ONLY:** Update your dynamic linker:
2016-05-15 15:03:07 -03:00
.. code-block:: console
$ sudo ldconfig
2016-05-16 20:13:26 -03:00
# or
$ export LD_LIBRARY_PATH=/usr/local/lib
2016-04-28 13:20:10 -03:00
2016-05-16 21:55:31 -03:00
**Linux ONLY:** Make sure you have ``python-dev``, ``python3-dev``,
``python-pip`` and ``libffi-dev`` installed:
2016-04-28 13:20:10 -03:00
2016-05-09 18:46:01 -03:00
.. code-block:: console
2016-05-16 21:55:31 -03:00
$ sudo apt-get update
$ sudo apt-get install python-dev python3-dev python-pip libffi-dev
Now, you can install ``wolfcrypt`` via ``pip`` or ``source code``:
2016-05-09 18:46:01 -03:00
2016-05-16 21:55:31 -03:00
wolfcrypt pip installation
~~~~~~~~~~~~~~~~~~~~~~~~~~
To install ``wolfcrypt`` with ``pip``:
2016-05-09 18:46:01 -03:00
.. code-block:: console
$ sudo -H pip install wolfcrypt
2016-04-28 13:20:10 -03:00
2016-05-09 18:46:01 -03:00
wolfcrypt source installation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2016-04-28 13:20:10 -03:00
2016-05-17 14:15:17 -03:00
1. Get the sources:
.. code-block:: console
$ git clone git@github.com:wolfssl/wolfssl.git
$ cd wolfssl/wrapper/python
2016-05-16 21:55:31 -03:00
**Before** proceeding with installation, you can test ``wolfcrypt`` locally with
2016-05-17 14:15:17 -03:00
``tox``. If you don't want to run the tests, jump to step 4 instead.
2016-05-09 18:46:01 -03:00
2016-05-17 14:15:17 -03:00
2. Make sure that the testing requirements are installed:
2016-05-09 18:46:01 -03:00
.. code-block:: console
2016-05-16 21:55:31 -03:00
$ sudo -H pip install -r requirements-testing.txt
2016-04-28 13:20:10 -03:00
2016-05-09 18:46:01 -03:00
2016-05-17 14:15:17 -03:00
3. Run ``tox``:
2016-04-28 13:20:10 -03:00
2016-05-09 18:46:01 -03:00
.. code-block:: console
2016-04-28 13:20:10 -03:00
2016-05-16 21:55:31 -03:00
$ tox
...
_________________________________ summary _________________________________
py27: commands succeeded
SKIPPED: py34: InterpreterNotFound: python3.4
py35: commands succeeded
congratulations :)
2016-05-09 18:46:01 -03:00
2016-05-16 21:55:31 -03:00
Note that some tests might be skipped if you don't have the proper interpreter.
2016-05-09 18:46:01 -03:00
2016-05-16 21:55:31 -03:00
**Now**, to install ``wolfcrypt`` from sources:
2016-05-09 18:46:01 -03:00
2016-05-17 14:15:17 -03:00
4. Build and install ``wolfcrypt``
2016-05-09 18:46:01 -03:00
.. code-block:: console
2016-05-16 21:55:31 -03:00
$ sudo python setup.py install
2016-04-28 13:20:10 -03:00
...
2016-05-16 21:55:31 -03:00
Finished processing dependencies for wolfcrypt...