python-pskc


Namepython-pskc JSON
Version 1.3 PyPI version JSON
download
home_pagehttps://arthurdejong.org/python-pskc/
SummaryPython module for handling PSKC files
upload_time2024-09-08 17:47:45
maintainerNone
docs_urlNone
authorArthur de Jong
requires_pythonNone
licenseLGPL
keywords pskc rfc 6030 key container
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Python module for handling PSKC files
=====================================

A Python module to handle Portable Symmetric Key Container (PSKC) files as
defined in `RFC 6030 <https://tools.ietf.org/html/rfc6030>`_. PSKC files are
used to transport and provision symmetric keys and key meta data (seed files)
to different types of crypto modules, commonly one-time password systems or
other authentication devices.

This module can be used to extract keys from PSKC files for use in an OTP
authentication system. The module can also be used for authoring PSKC files.

This module should be able to handle most common PSKC files.

https://arthurdejong.org/python-pskc/


API
---

The module provides a straightforward API that is mostly geared towards
parsing existing PSKC files.

Extracting key material from encrypted PSKC files is as simple as:

>>> from pskc import PSKC
>>> pskc = PSKC('tests/rfc6030/figure7.pskcxml')
>>> pskc.encryption.derive_key('qwerty')
>>> for key in pskc.keys:
...     print('%s %s' % (key.serial, str(key.secret.decode())))
987654321 12345678901234567890

Writing am encrypted PSKC file is as simple as:

>>> pskc = PSKC()
>>> key = pskc.add_key(
...     id='456', secret='987654321', manufacturer='Manufacturer',
...     algorithm = 'urn:ietf:params:xml:ns:keyprov:pskc:hotp')
>>> pskc.encryption.setup_pbkdf2('passphrase')
>>> pskc.write('output.pskcxml')

The key object has a number of properties. See the pskc.key.Key documentation
for details.


Security considerations
-----------------------

This code handles private key material and is written in Python. No
precautions have been taken to lock pages in memory to prevent swapping. Also
no attempt is currently made to securely dispose of memory that may have held
private key material.


Copyright
---------

Copyright (C) 2014-2024 Arthur de Jong

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA

            

Raw data

            {
    "_id": null,
    "home_page": "https://arthurdejong.org/python-pskc/",
    "name": "python-pskc",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "PSKC, RFC 6030, key container",
    "author": "Arthur de Jong",
    "author_email": "arthur@arthurdejong.org",
    "download_url": "https://files.pythonhosted.org/packages/51/b4/91cc042a24d3840580a0c5d66cb10b96ca651497d1f4c0902a91c66147bd/python-pskc-1.3.tar.gz",
    "platform": null,
    "description": "Python module for handling PSKC files\n=====================================\n\nA Python module to handle Portable Symmetric Key Container (PSKC) files as\ndefined in `RFC 6030 <https://tools.ietf.org/html/rfc6030>`_. PSKC files are\nused to transport and provision symmetric keys and key meta data (seed files)\nto different types of crypto modules, commonly one-time password systems or\nother authentication devices.\n\nThis module can be used to extract keys from PSKC files for use in an OTP\nauthentication system. The module can also be used for authoring PSKC files.\n\nThis module should be able to handle most common PSKC files.\n\nhttps://arthurdejong.org/python-pskc/\n\n\nAPI\n---\n\nThe module provides a straightforward API that is mostly geared towards\nparsing existing PSKC files.\n\nExtracting key material from encrypted PSKC files is as simple as:\n\n>>> from pskc import PSKC\n>>> pskc = PSKC('tests/rfc6030/figure7.pskcxml')\n>>> pskc.encryption.derive_key('qwerty')\n>>> for key in pskc.keys:\n...     print('%s %s' % (key.serial, str(key.secret.decode())))\n987654321 12345678901234567890\n\nWriting am encrypted PSKC file is as simple as:\n\n>>> pskc = PSKC()\n>>> key = pskc.add_key(\n...     id='456', secret='987654321', manufacturer='Manufacturer',\n...     algorithm = 'urn:ietf:params:xml:ns:keyprov:pskc:hotp')\n>>> pskc.encryption.setup_pbkdf2('passphrase')\n>>> pskc.write('output.pskcxml')\n\nThe key object has a number of properties. See the pskc.key.Key documentation\nfor details.\n\n\nSecurity considerations\n-----------------------\n\nThis code handles private key material and is written in Python. No\nprecautions have been taken to lock pages in memory to prevent swapping. Also\nno attempt is currently made to securely dispose of memory that may have held\nprivate key material.\n\n\nCopyright\n---------\n\nCopyright (C) 2014-2024 Arthur de Jong\n\nThis library is free software; you can redistribute it and/or\nmodify it under the terms of the GNU Lesser General Public\nLicense as published by the Free Software Foundation; either\nversion 2.1 of the License, or (at your option) any later version.\n\nThis library is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this library; if not, write to the Free Software\nFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\n02110-1301 USA\n",
    "bugtrack_url": null,
    "license": "LGPL",
    "summary": "Python module for handling PSKC files",
    "version": "1.3",
    "project_urls": {
        "Homepage": "https://arthurdejong.org/python-pskc/"
    },
    "split_keywords": [
        "pskc",
        " rfc 6030",
        " key container"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "682f0b038974f663ae07a4c54a0c48878fe91d866d8b973db66aa2c0eb025680",
                "md5": "09d7dd9cf7c527e6a2b63f5d0dc8eb20",
                "sha256": "b0b86ecef3bfc1d9be3bf24df28d6499e7ec1015230f4b4ef09b933a23832860"
            },
            "downloads": -1,
            "filename": "python_pskc-1.3-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "09d7dd9cf7c527e6a2b63f5d0dc8eb20",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 53095,
            "upload_time": "2024-09-08T17:47:43",
            "upload_time_iso_8601": "2024-09-08T17:47:43.391848Z",
            "url": "https://files.pythonhosted.org/packages/68/2f/0b038974f663ae07a4c54a0c48878fe91d866d8b973db66aa2c0eb025680/python_pskc-1.3-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "51b491cc042a24d3840580a0c5d66cb10b96ca651497d1f4c0902a91c66147bd",
                "md5": "c863f0149b0332c89a4d8250e7e23b77",
                "sha256": "6ae3671887383bf7b77e019d2c2d43f1f289443cc6ebd20e3a8367cd5a7ee903"
            },
            "downloads": -1,
            "filename": "python-pskc-1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "c863f0149b0332c89a4d8250e7e23b77",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 130806,
            "upload_time": "2024-09-08T17:47:45",
            "upload_time_iso_8601": "2024-09-08T17:47:45.498260Z",
            "url": "https://files.pythonhosted.org/packages/51/b4/91cc042a24d3840580a0c5d66cb10b96ca651497d1f4c0902a91c66147bd/python-pskc-1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-08 17:47:45",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "python-pskc"
}
        
Elapsed time: 0.35501s