From 702b4479e516ee3618fe4d03bb0915bb8b2b516f Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Wed, 15 Jan 2014 21:26:38 +0100 Subject: [PATCH] Also include example for versions prior to 1.9.0. --- docs/index.rst | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 8cc75cd..2bd7ed4 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -49,8 +49,8 @@ Single mode: from yubico_client import Yubico - yubico = Yubico('client id', 'secret key') - yubico.verify('otp') + client = Yubico('client id', 'secret key') + client.verify('otp') The :func:`yubico_client.Yubico.verify` method will return ``True`` if the provided OTP is valid (``STATUS=OK``). @@ -61,8 +61,8 @@ Multi mode: from yubico_client import Yubico - yubico = Yubico('client id', 'secret key') - yubico.verify_multi(['otp 1', 'otp 2', 'otp 3']) + client = Yubico('client id', 'secret key') + client.verify_multi(['otp 1', 'otp 2', 'otp 3']) The :func:`yubico_client.Yubico.verify` method will return ``True`` if all of the provided OTPs are valid (``STATUS=OK``). @@ -97,15 +97,25 @@ bundle which only contains root CA certificate for ``api.yubico.com`` domain), you can do so by passing ``ca_certs_bundle_path`` argument to the ``Yubico`` class constructor. -For example: +For example (version 1.9.0 and above): .. code-block:: python from yubico_client import Yubico - yubico = Yubico('client id', 'secret key', + client = Yubico('client id', 'secret key', ca_certs_bundle_path='/home/to/my/bundle.pem') +For example (versions prior to 1.9.0): + +.. code-block:: python + + from yubico_client import yubico + + yubico.CA_CERTS_BUNDLE_PATH = '/home/to/my/bundle.pem' + client = yubico.Yubico('client id', 'secret key', + ca_certs_bundle_path='/home/to/my/bundle.pem') + Keep in mind that this bundle needs to be in PEM format. API Documentation