python-pkcs11


Namepython-pkcs11 JSON
Version 0.7.0 PyPI version JSON
download
home_pagehttps://github.com/danni/python-pkcs11
SummaryPKCS#11 (Cryptoki) support for Python
upload_time2020-08-20 23:54:23
maintainer
docs_urlNone
authorDanielle Madeley
requires_python
license
keywords
VCS
bugtrack_url
requirements aenum asn1crypto cached-property
Travis-CI
coveralls test coverage No coveralls.
            Python PKCS#11 - High Level Wrapper API
=======================================

A high level, "more Pythonic" interface to the PKCS#11 (Cryptoki) standard
to support HSM and Smartcard devices in Python.

The interface is designed to follow the logical structure of a HSM, with
useful defaults for obscurely documented parameters. Many APIs will optionally
accept iterables and act as generators, allowing you to stream large data
blocks for symmetric encryption.

python-pkcs11 also includes numerous utility functions to convert between PKCS
#11 data structures and common interchange formats including PKCS #1 and X.509.

python-pkcs11 is fully documented and has a full integration test suite for all
features, with continuous integration against multiple HSM platforms including:

* Thales nCipher
* Opencryptoki TPM
* OpenSC/Smartcard-HSM/Nitrokey HSM

Source: https://github.com/danni/python-pkcs11

Documentation: http://python-pkcs11.readthedocs.io/en/latest/

Getting Started
---------------

Install from Pip:

::

    pip install python-pkcs11


Or build from source:

::

    python setup.py build

Assuming your PKCS#11 library is set as `PKCS11_MODULE` and contains a
token named `DEMO`:

AES
~~~

::

    import pkcs11

    # Initialise our PKCS#11 library
    lib = pkcs11.lib(os.environ['PKCS11_MODULE'])
    token = lib.get_token(token_label='DEMO')

    data = b'INPUT DATA'

    # Open a session on our token
    with token.open(user_pin='1234') as session:
        # Generate an AES key in this session
        key = session.generate_key(pkcs11.KeyType.AES, 256)

        # Get an initialisation vector
        iv = session.generate_random(128)  # AES blocks are fixed at 128 bits
        # Encrypt our data
        crypttext = key.encrypt(data, mechanism_param=iv)

3DES
~~~~

::

    import pkcs11

    # Initialise our PKCS#11 library
    lib = pkcs11.lib(os.environ['PKCS11_MODULE'])
    token = lib.get_token(token_label='DEMO')

    data = b'INPUT DATA'

    # Open a session on our token
    with token.open(user_pin='1234') as session:
        # Generate a DES key in this session
        key = session.generate_key(pkcs11.KeyType.DES3)

        # Get an initialisation vector
        iv = session.generate_random(64)  # DES blocks are fixed at 64 bits
        # Encrypt our data
        crypttext = key.encrypt(data, mechanism_param=iv)

RSA
~~~

::

    import pkcs11

    lib = pkcs11.lib(os.environ['PKCS11_MODULE'])
    token = lib.get_token(token_label='DEMO')

    data = b'INPUT DATA'

    # Open a session on our token
    with token.open(user_pin='1234') as session:
        # Generate an RSA keypair in this session
        pub, priv = session.generate_keypair(pkcs11.KeyType.RSA, 2048)

        # Encrypt as one block
        crypttext = pub.encrypt(data)

DSA
~~~

::

    import pkcs11

    lib = pkcs11.lib(os.environ['PKCS11_MODULE'])
    token = lib.get_token(token_label='DEMO')

    data = b'INPUT DATA'

    # Open a session on our token
    with token.open(user_pin='1234') as session:
        # Generate an DSA keypair in this session
        pub, priv = session.generate_keypair(pkcs11.KeyType.DSA, 1024)

        # Sign
        signature = priv.sign(data)

ECDSA
~~~~~

::

    import pkcs11

    lib = pkcs11.lib(os.environ['PKCS11_MODULE'])
    token = lib.get_token(token_label='DEMO')

    data = b'INPUT DATA'

    # Open a session on our token
    with token.open(user_pin='1234') as session:
        # Generate an EC keypair in this session from a named curve
        ecparams = session.create_domain_parameters(
            pkcs11.KeyType.EC, {
                pkcs11.Attribute.EC_PARAMS: pkcs11.util.ec.encode_named_curve_parameters('prime256v1'),
            }, local=True)
        pub, priv = ecparams.generate_keypair()

        # Sign
        signature = priv.sign(data)

Diffie-Hellman
~~~~~~~~~~~~~~

::

    import pkcs11

    lib = pkcs11.lib(os.environ['PKCS11_MODULE'])
    token = lib.get_token(token_label='DEMO')

    with token.open() as session:
        # Given shared Diffie-Hellman parameters
        parameters = session.create_domain_parameters(pkcs11.KeyType.DH, {
            pkcs11.Attribute.PRIME: prime,  # Diffie-Hellman parameters
            pkcs11.Attribute.BASE: base,
        })

        # Generate a DH key pair from the public parameters
        public, private = parameters.generate_keypair()

        # Share the public half of it with our other party.
        _network_.write(public[Attribute.VALUE])
        # And get their shared value
        other_value = _network_.read()

        # Derive a shared session key with perfect forward secrecy
        session_key = private.derive_key(
            pkcs11.KeyType.AES, 128,
            mechanism_param=other_value)


Elliptic-Curve Diffie-Hellman
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

::

    import pkcs11

    lib = pkcs11.lib(os.environ['PKCS11_MODULE'])
    token = lib.get_token(token_label='DEMO')

    with token.open() as session:
        # Given DER encocded EC parameters, e.g. from
        #    openssl ecparam -outform der -name <named curve>
        parameters = session.create_domain_parameters(pkcs11.KeyType.EC, {
            pkcs11.Attribute.EC_PARAMS: ecparams,
        })

        # Generate a DH key pair from the public parameters
        public, private = parameters.generate_keypair()

        # Share the public half of it with our other party.
        _network_.write(public[pkcs11.Attribute.EC_POINT])
        # And get their shared value
        other_value = _network_.read()

        # Derive a shared session key
        session_key = private.derive_key(
            pkcs11.KeyType.AES, 128,
            mechanism_param=(pkcs11.KDF.NULL, None, other_value))

Tested Compatibility
--------------------

+------------------------------+--------------+-----------------+--------------+-------------------+
| Functionality                | SoftHSMv2    | Thales nCipher  | Opencryptoki | OpenSC (Nitrokey) |
+==============================+==============+=================+==============+===================+
| Get Slots/Tokens             | Works        | Works           | Works        | Works             |
+------------------------------+--------------+-----------------+--------------+-------------------+
| Get Mechanisms               | Works        | Works           | Works        | Works             |
+------------------------------+--------------+-----------------+--------------+-------------------+
| Initialize token             | Not implemented                                                   |
+------------------------------+-------------------------------------------------------------------+
| Slot events                  | Not implemented                                                   |
+------------------------------+-------------------------------------------------------------------+
| Alternative authentication   | Not implemented                                                   |
| path                         |                                                                   |
+------------------------------+-------------------------------------------------------------------+
| `Always authenticate` keys   | Not implemented                                                   |
+-------------+----------------+--------------+-----------------+--------------+-------------------+
| Create/Copy | Keys           | Works        | Works           | Errors       | Create            |
|             +----------------+--------------+-----------------+--------------+-------------------+
|             | Certificates   | Caveats [1]_ | Caveats [1]_    | Caveats [1]_ | ?                 |
|             +----------------+--------------+-----------------+--------------+-------------------+
|             | Domain Params  | Caveats [1]_ | Caveats [1]_    | ?            | N/A               |
+-------------+----------------+--------------+-----------------+--------------+-------------------+
| Destroy Object               | Works        | N/A             | Works        | Works             |
+------------------------------+--------------+-----------------+--------------+-------------------+
| Generate Random              | Works        | Works           | Works        | Works             |
+------------------------------+--------------+-----------------+--------------+-------------------+
| Seed Random                  | Works        | N/A             | N/A          | N/A               |
+------------------------------+--------------+-----------------+--------------+-------------------+
| Digest (Data & Keys)         | Works        | Caveats [2]_    | Works        | Works             |
+--------+---------------------+--------------+-----------------+--------------+-------------------+
| AES    | Generate key        | Works        | Works           | Works        | N/A               |
|        +---------------------+--------------+-----------------+--------------+                   |
|        | Encrypt/Decrypt     | Works        | Works           | Works        |                   |
|        +---------------------+--------------+-----------------+--------------+                   |
|        | Wrap/Unwrap         | ? [3]_       | Works           | Errors       |                   |
|        +---------------------+--------------+-----------------+--------------+                   |
|        | Sign/Verify         | Works        | Works [4]_      | N/A          |                   |
+--------+---------------------+--------------+-----------------+--------------+-------------------+
| DES2/  | Generate key        | Works        | Works           | Works        | N/A               |
| DES3   +---------------------+--------------+-----------------+--------------+                   |
|        | Encrypt/Decrypt     | Works        | Works           | Works        |                   |
|        +---------------------+--------------+-----------------+--------------+                   |
|        | Wrap/Unwrap         | ?            | ?               | ?            |                   |
|        +---------------------+--------------+-----------------+--------------+                   |
|        | Sign/Verify         | ?            | ?               | ?            |                   |
+--------+---------------------+--------------+-----------------+--------------+-------------------+
| RSA    | Generate key pair   | Works        | Works           | Works        | Works [4]_ [8]_   |
|        +---------------------+--------------+-----------------+--------------+-------------------+
|        | Encrypt/Decrypt     | Works        | Works           | Works        | Decrypt only [9]_ |
|        +---------------------+--------------+-----------------+--------------+-------------------+
|        | Wrap/Unwrap         | Works        | Works           | Works        | N/A               |
|        +---------------------+--------------+-----------------+--------------+-------------------+
|        | Sign/Verify         | Works        | Works           | Works        | Works             |
+--------+---------------------+--------------+-----------------+--------------+-------------------+
| DSA    | Generate parameters | Works        | Error           | N/A          | N/A               |
|        +---------------------+--------------+-----------------+              |                   |
|        | Generate key pair   | Works        | Caveats [5]_    |              |                   |
|        +---------------------+--------------+-----------------+              |                   |
|        | Sign/Verify         | Works        | Works [4]_      |              |                   |
+--------+---------------------+--------------+-----------------+--------------+-------------------+
| DH     | Generate parameters | Works        | N/A             | N/A          | N/A               |
|        +---------------------+--------------+-----------------+              |                   |
|        | Generate key pair   | Works        | Caveats [6]_    |              |                   |
|        +---------------------+--------------+-----------------+              |                   |
|        | Derive Key          | Works        | Caveats [7]_    |              |                   |
+--------+---------------------+--------------+-----------------+--------------+-------------------+
| EC     | Generate key pair   | Caveats [6]_ | ? [3]_          | N/A          | Works             |
|        +---------------------+--------------+-----------------+              +-------------------+
|        | Sign/Verify (ECDSA) | Works [4]_   | ? [3]_          |              | Sign only [9]_    |
|        +---------------------+--------------+-----------------+              +-------------------+
|        | Derive key (ECDH)   | Works        | ? [3]_          |              | ?                 |
+--------+---------------------+--------------+-----------------+--------------+-------------------+
| Proprietary extensions       | N/A          | Not implemented | N/A          | N/A               |
+------------------------------+--------------+-----------------+--------------+-------------------+

.. [1] Device supports limited set of attributes.
.. [2] Digesting keys is not supported.
.. [3] Untested: requires support in device.
.. [4] Default mechanism not supported, must specify a mechanism.
.. [5] From existing domain parameters.
.. [6] Local domain parameters only.
.. [7] Generates security warnings about the derived key.
.. [8] `store` parameter is ignored, all keys are stored.
.. [9] Encryption/verify not supported, extract the public key

Python version:

* 3.4 (with `aenum`)
* 3.5 (with `aenum`)
* 3.6

PKCS#11 versions:

* 2.11
* 2.20
* 2.40

Feel free to send pull requests for any functionality that's not exposed. The
code is designed to be readable and expose the PKCS #11 spec in a
straight-forward way.

If you want your device supported, get in touch!

More info on PKCS #11
---------------------

The latest version of the PKCS #11 spec is available from OASIS:

http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/pkcs11-base-v2.40.html

You should also consult the documentation for your PKCS #11 implementation.
Many implementations expose additional vendor options configurable in your
environment, including alternative features, modes and debugging
information.

License
-------

MIT License

Copyright (c) 2017 Danielle Madeley

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/danni/python-pkcs11",
    "name": "python-pkcs11",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Danielle Madeley",
    "author_email": "danielle@madeley.id.au",
    "download_url": "https://files.pythonhosted.org/packages/3e/24/9d55a78b3501201d2dfeb035ce1b139f8846505b3ddb9cadb4c2254259d0/python-pkcs11-0.7.0.tar.gz",
    "platform": "",
    "description": "Python PKCS#11 - High Level Wrapper API\n=======================================\n\nA high level, \"more Pythonic\" interface to the PKCS#11 (Cryptoki) standard\nto support HSM and Smartcard devices in Python.\n\nThe interface is designed to follow the logical structure of a HSM, with\nuseful defaults for obscurely documented parameters. Many APIs will optionally\naccept iterables and act as generators, allowing you to stream large data\nblocks for symmetric encryption.\n\npython-pkcs11 also includes numerous utility functions to convert between PKCS\n#11 data structures and common interchange formats including PKCS #1 and X.509.\n\npython-pkcs11 is fully documented and has a full integration test suite for all\nfeatures, with continuous integration against multiple HSM platforms including:\n\n* Thales nCipher\n* Opencryptoki TPM\n* OpenSC/Smartcard-HSM/Nitrokey HSM\n\nSource: https://github.com/danni/python-pkcs11\n\nDocumentation: http://python-pkcs11.readthedocs.io/en/latest/\n\nGetting Started\n---------------\n\nInstall from Pip:\n\n::\n\n    pip install python-pkcs11\n\n\nOr build from source:\n\n::\n\n    python setup.py build\n\nAssuming your PKCS#11 library is set as `PKCS11_MODULE` and contains a\ntoken named `DEMO`:\n\nAES\n~~~\n\n::\n\n    import pkcs11\n\n    # Initialise our PKCS#11 library\n    lib = pkcs11.lib(os.environ['PKCS11_MODULE'])\n    token = lib.get_token(token_label='DEMO')\n\n    data = b'INPUT DATA'\n\n    # Open a session on our token\n    with token.open(user_pin='1234') as session:\n        # Generate an AES key in this session\n        key = session.generate_key(pkcs11.KeyType.AES, 256)\n\n        # Get an initialisation vector\n        iv = session.generate_random(128)  # AES blocks are fixed at 128 bits\n        # Encrypt our data\n        crypttext = key.encrypt(data, mechanism_param=iv)\n\n3DES\n~~~~\n\n::\n\n    import pkcs11\n\n    # Initialise our PKCS#11 library\n    lib = pkcs11.lib(os.environ['PKCS11_MODULE'])\n    token = lib.get_token(token_label='DEMO')\n\n    data = b'INPUT DATA'\n\n    # Open a session on our token\n    with token.open(user_pin='1234') as session:\n        # Generate a DES key in this session\n        key = session.generate_key(pkcs11.KeyType.DES3)\n\n        # Get an initialisation vector\n        iv = session.generate_random(64)  # DES blocks are fixed at 64 bits\n        # Encrypt our data\n        crypttext = key.encrypt(data, mechanism_param=iv)\n\nRSA\n~~~\n\n::\n\n    import pkcs11\n\n    lib = pkcs11.lib(os.environ['PKCS11_MODULE'])\n    token = lib.get_token(token_label='DEMO')\n\n    data = b'INPUT DATA'\n\n    # Open a session on our token\n    with token.open(user_pin='1234') as session:\n        # Generate an RSA keypair in this session\n        pub, priv = session.generate_keypair(pkcs11.KeyType.RSA, 2048)\n\n        # Encrypt as one block\n        crypttext = pub.encrypt(data)\n\nDSA\n~~~\n\n::\n\n    import pkcs11\n\n    lib = pkcs11.lib(os.environ['PKCS11_MODULE'])\n    token = lib.get_token(token_label='DEMO')\n\n    data = b'INPUT DATA'\n\n    # Open a session on our token\n    with token.open(user_pin='1234') as session:\n        # Generate an DSA keypair in this session\n        pub, priv = session.generate_keypair(pkcs11.KeyType.DSA, 1024)\n\n        # Sign\n        signature = priv.sign(data)\n\nECDSA\n~~~~~\n\n::\n\n    import pkcs11\n\n    lib = pkcs11.lib(os.environ['PKCS11_MODULE'])\n    token = lib.get_token(token_label='DEMO')\n\n    data = b'INPUT DATA'\n\n    # Open a session on our token\n    with token.open(user_pin='1234') as session:\n        # Generate an EC keypair in this session from a named curve\n        ecparams = session.create_domain_parameters(\n            pkcs11.KeyType.EC, {\n                pkcs11.Attribute.EC_PARAMS: pkcs11.util.ec.encode_named_curve_parameters('prime256v1'),\n            }, local=True)\n        pub, priv = ecparams.generate_keypair()\n\n        # Sign\n        signature = priv.sign(data)\n\nDiffie-Hellman\n~~~~~~~~~~~~~~\n\n::\n\n    import pkcs11\n\n    lib = pkcs11.lib(os.environ['PKCS11_MODULE'])\n    token = lib.get_token(token_label='DEMO')\n\n    with token.open() as session:\n        # Given shared Diffie-Hellman parameters\n        parameters = session.create_domain_parameters(pkcs11.KeyType.DH, {\n            pkcs11.Attribute.PRIME: prime,  # Diffie-Hellman parameters\n            pkcs11.Attribute.BASE: base,\n        })\n\n        # Generate a DH key pair from the public parameters\n        public, private = parameters.generate_keypair()\n\n        # Share the public half of it with our other party.\n        _network_.write(public[Attribute.VALUE])\n        # And get their shared value\n        other_value = _network_.read()\n\n        # Derive a shared session key with perfect forward secrecy\n        session_key = private.derive_key(\n            pkcs11.KeyType.AES, 128,\n            mechanism_param=other_value)\n\n\nElliptic-Curve Diffie-Hellman\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n::\n\n    import pkcs11\n\n    lib = pkcs11.lib(os.environ['PKCS11_MODULE'])\n    token = lib.get_token(token_label='DEMO')\n\n    with token.open() as session:\n        # Given DER encocded EC parameters, e.g. from\n        #    openssl ecparam -outform der -name <named curve>\n        parameters = session.create_domain_parameters(pkcs11.KeyType.EC, {\n            pkcs11.Attribute.EC_PARAMS: ecparams,\n        })\n\n        # Generate a DH key pair from the public parameters\n        public, private = parameters.generate_keypair()\n\n        # Share the public half of it with our other party.\n        _network_.write(public[pkcs11.Attribute.EC_POINT])\n        # And get their shared value\n        other_value = _network_.read()\n\n        # Derive a shared session key\n        session_key = private.derive_key(\n            pkcs11.KeyType.AES, 128,\n            mechanism_param=(pkcs11.KDF.NULL, None, other_value))\n\nTested Compatibility\n--------------------\n\n+------------------------------+--------------+-----------------+--------------+-------------------+\n| Functionality                | SoftHSMv2    | Thales nCipher  | Opencryptoki | OpenSC (Nitrokey) |\n+==============================+==============+=================+==============+===================+\n| Get Slots/Tokens             | Works        | Works           | Works        | Works             |\n+------------------------------+--------------+-----------------+--------------+-------------------+\n| Get Mechanisms               | Works        | Works           | Works        | Works             |\n+------------------------------+--------------+-----------------+--------------+-------------------+\n| Initialize token             | Not implemented                                                   |\n+------------------------------+-------------------------------------------------------------------+\n| Slot events                  | Not implemented                                                   |\n+------------------------------+-------------------------------------------------------------------+\n| Alternative authentication   | Not implemented                                                   |\n| path                         |                                                                   |\n+------------------------------+-------------------------------------------------------------------+\n| `Always authenticate` keys   | Not implemented                                                   |\n+-------------+----------------+--------------+-----------------+--------------+-------------------+\n| Create/Copy | Keys           | Works        | Works           | Errors       | Create            |\n|             +----------------+--------------+-----------------+--------------+-------------------+\n|             | Certificates   | Caveats [1]_ | Caveats [1]_    | Caveats [1]_ | ?                 |\n|             +----------------+--------------+-----------------+--------------+-------------------+\n|             | Domain Params  | Caveats [1]_ | Caveats [1]_    | ?            | N/A               |\n+-------------+----------------+--------------+-----------------+--------------+-------------------+\n| Destroy Object               | Works        | N/A             | Works        | Works             |\n+------------------------------+--------------+-----------------+--------------+-------------------+\n| Generate Random              | Works        | Works           | Works        | Works             |\n+------------------------------+--------------+-----------------+--------------+-------------------+\n| Seed Random                  | Works        | N/A             | N/A          | N/A               |\n+------------------------------+--------------+-----------------+--------------+-------------------+\n| Digest (Data & Keys)         | Works        | Caveats [2]_    | Works        | Works             |\n+--------+---------------------+--------------+-----------------+--------------+-------------------+\n| AES    | Generate key        | Works        | Works           | Works        | N/A               |\n|        +---------------------+--------------+-----------------+--------------+                   |\n|        | Encrypt/Decrypt     | Works        | Works           | Works        |                   |\n|        +---------------------+--------------+-----------------+--------------+                   |\n|        | Wrap/Unwrap         | ? [3]_       | Works           | Errors       |                   |\n|        +---------------------+--------------+-----------------+--------------+                   |\n|        | Sign/Verify         | Works        | Works [4]_      | N/A          |                   |\n+--------+---------------------+--------------+-----------------+--------------+-------------------+\n| DES2/  | Generate key        | Works        | Works           | Works        | N/A               |\n| DES3   +---------------------+--------------+-----------------+--------------+                   |\n|        | Encrypt/Decrypt     | Works        | Works           | Works        |                   |\n|        +---------------------+--------------+-----------------+--------------+                   |\n|        | Wrap/Unwrap         | ?            | ?               | ?            |                   |\n|        +---------------------+--------------+-----------------+--------------+                   |\n|        | Sign/Verify         | ?            | ?               | ?            |                   |\n+--------+---------------------+--------------+-----------------+--------------+-------------------+\n| RSA    | Generate key pair   | Works        | Works           | Works        | Works [4]_ [8]_   |\n|        +---------------------+--------------+-----------------+--------------+-------------------+\n|        | Encrypt/Decrypt     | Works        | Works           | Works        | Decrypt only [9]_ |\n|        +---------------------+--------------+-----------------+--------------+-------------------+\n|        | Wrap/Unwrap         | Works        | Works           | Works        | N/A               |\n|        +---------------------+--------------+-----------------+--------------+-------------------+\n|        | Sign/Verify         | Works        | Works           | Works        | Works             |\n+--------+---------------------+--------------+-----------------+--------------+-------------------+\n| DSA    | Generate parameters | Works        | Error           | N/A          | N/A               |\n|        +---------------------+--------------+-----------------+              |                   |\n|        | Generate key pair   | Works        | Caveats [5]_    |              |                   |\n|        +---------------------+--------------+-----------------+              |                   |\n|        | Sign/Verify         | Works        | Works [4]_      |              |                   |\n+--------+---------------------+--------------+-----------------+--------------+-------------------+\n| DH     | Generate parameters | Works        | N/A             | N/A          | N/A               |\n|        +---------------------+--------------+-----------------+              |                   |\n|        | Generate key pair   | Works        | Caveats [6]_    |              |                   |\n|        +---------------------+--------------+-----------------+              |                   |\n|        | Derive Key          | Works        | Caveats [7]_    |              |                   |\n+--------+---------------------+--------------+-----------------+--------------+-------------------+\n| EC     | Generate key pair   | Caveats [6]_ | ? [3]_          | N/A          | Works             |\n|        +---------------------+--------------+-----------------+              +-------------------+\n|        | Sign/Verify (ECDSA) | Works [4]_   | ? [3]_          |              | Sign only [9]_    |\n|        +---------------------+--------------+-----------------+              +-------------------+\n|        | Derive key (ECDH)   | Works        | ? [3]_          |              | ?                 |\n+--------+---------------------+--------------+-----------------+--------------+-------------------+\n| Proprietary extensions       | N/A          | Not implemented | N/A          | N/A               |\n+------------------------------+--------------+-----------------+--------------+-------------------+\n\n.. [1] Device supports limited set of attributes.\n.. [2] Digesting keys is not supported.\n.. [3] Untested: requires support in device.\n.. [4] Default mechanism not supported, must specify a mechanism.\n.. [5] From existing domain parameters.\n.. [6] Local domain parameters only.\n.. [7] Generates security warnings about the derived key.\n.. [8] `store` parameter is ignored, all keys are stored.\n.. [9] Encryption/verify not supported, extract the public key\n\nPython version:\n\n* 3.4 (with `aenum`)\n* 3.5 (with `aenum`)\n* 3.6\n\nPKCS#11 versions:\n\n* 2.11\n* 2.20\n* 2.40\n\nFeel free to send pull requests for any functionality that's not exposed. The\ncode is designed to be readable and expose the PKCS #11 spec in a\nstraight-forward way.\n\nIf you want your device supported, get in touch!\n\nMore info on PKCS #11\n---------------------\n\nThe latest version of the PKCS #11 spec is available from OASIS:\n\nhttp://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/pkcs11-base-v2.40.html\n\nYou should also consult the documentation for your PKCS #11 implementation.\nMany implementations expose additional vendor options configurable in your\nenvironment, including alternative features, modes and debugging\ninformation.\n\nLicense\n-------\n\nMIT License\n\nCopyright (c) 2017 Danielle Madeley\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.",
    "bugtrack_url": null,
    "license": "",
    "summary": "PKCS#11 (Cryptoki) support for Python",
    "version": "0.7.0",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "4998d6f038d2997958f2004f482580da",
                "sha256": "9737e0c24cabb8bc9d48bf8c57c3df2a70f8cdd96b70c50290803286f9e46bf7"
            },
            "downloads": -1,
            "filename": "python-pkcs11-0.7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4998d6f038d2997958f2004f482580da",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 106517,
            "upload_time": "2020-08-20T23:54:23",
            "upload_time_iso_8601": "2020-08-20T23:54:23.205078Z",
            "url": "https://files.pythonhosted.org/packages/3e/24/9d55a78b3501201d2dfeb035ce1b139f8846505b3ddb9cadb4c2254259d0/python-pkcs11-0.7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-08-20 23:54:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "danni",
    "github_project": "python-pkcs11",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "aenum",
            "specs": [
                [
                    "==",
                    "2.0.7"
                ]
            ]
        },
        {
            "name": "asn1crypto",
            "specs": [
                [
                    "==",
                    "1.4.0"
                ]
            ]
        },
        {
            "name": "cached-property",
            "specs": [
                [
                    "==",
                    "1.5.2"
                ]
            ]
        }
    ],
    "lcname": "python-pkcs11"
}
        
Elapsed time: 0.01221s