{ "info": { "author": "uishnik", "author_email": "uishnik@yandex.ru", "bugtrack_url": null, "classifiers": [], "description": "pycryptoprosdk\n==============\n\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Cryptopro CSP \u0432 python\n\n\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430\n---------\n* \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e CSP.\n* \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u044b lsb-cprocsp-devel-.noarch.rpm \u0438 cprocsp-pki-amd64-cades.rpm \u0438\u0437 \u0441\u043e\u0441\u0442\u0430\u0432\u0430 \u041a\u0440\u0438\u043f\u0442\u043e\u041f\u0440\u043e \u042d\u0426\u041f SDK.\n* \u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0438\u043c\u043b\u0438\u043d\u043a:\n\n.. code-block:: shell\n\n ln -s /opt/cprocsp/lib/amd64/libcades.so.2.0.0 /opt/cprocsp/lib/amd64/libcades.so\n\n\u041f\u0440\u0438\u043c\u0435\u0440 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 `pycryptoprosdk/compose/Dockerfile `_.\n\n* \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c pycryptoprosdk:\n\n.. code-block:: shell\n\n pip install pycryptoprosdk\n\n\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f\n---------------------\n.. code-block:: python\n\n from pycryptoprosdk import CryptoProSDK\n\n\n sdk = CryptoProSDK()\n\n\n # \u0432\u0435\u0440\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043e\u0442\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u043f\u0438\u0441\u0438:\n with open('doc.txt', 'rb') as f:\n content = b64encode(f.read())\n\n with open('doc.txt.sig', 'rb') as f:\n signature = b64encode(f.read())\n\n res = sdk.verify_detached(content, signature)\n\n\n # \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0445\u044d\u0448\u0430 \u0444\u0430\u0439\u043b\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u0413\u041e\u0421\u0422 \u0420 34.11-94:\n with open('doc.txt'), 'rb') as f:\n content = f.read()\n h = sdk.create_hash(content, alg='CALG_GR3411')\n\n\n # \u043f\u043e\u0438\u0441\u043a \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 MY \u043f\u043e \u043e\u0442\u043f\u0435\u0447\u0430\u0442\u043a\u0443:\n cert = sdk.get_cert_by_thumbprint('MY', '046255290b0eb1cdd1797d9ab8c81f699e3687f3')\n\n\n # \u043f\u043e\u0438\u0441\u043a \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u043f\u043e \u0438\u043c\u0435\u043d\u0438:\n cert = sdk.get_cert_by_subject('MY', 'CRYPTO-PRO Test Center 2')\n\n\n # \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 MY:\n with open('certificate.cer'), 'rb') as f:\n cert_content = f.read()\n sdk.install_certificate('MY', b64encode(cert_content))\n\n\n # \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u0438\u0437 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 MY \u043f\u043e \u043e\u0442\u043f\u0435\u0447\u0430\u0442\u043a\u0443:\n sdk.delete_certificate('MY', '9e78a331020e528c046ffd57704a21b7d2241cb3')\n\n\n # \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u0442\u0430 \u0438\u0437 \u043f\u043e\u0434\u043f\u0438\u0441\u0438:\n with open('signature.sig', 'rb') as f:\n signature_content = f.read()\n cert = sdk.get_signer_cert_from_signature(signature_content)\n\n\n\u0421\u0431\u043e\u0440\u043a\u0430 \u043e\u0431\u0440\u0430\u0437\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u043e\u0432\n-----------------------------\n.. code-block:: shell\n\n docker-compose up --build --force-recreate", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Keyintegrity/pycryptoprosdk", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pycryptoprosdk", "package_url": "https://pypi.org/project/pycryptoprosdk/", "platform": "", "project_url": "https://pypi.org/project/pycryptoprosdk/", "project_urls": { "Homepage": "https://github.com/Keyintegrity/pycryptoprosdk" }, "release_url": "https://pypi.org/project/pycryptoprosdk/0.1.5/", "requires_dist": null, "requires_python": "", "summary": "", "version": "0.1.5" }, "last_serial": 5954914, "releases": { "0.1.3": [ { "comment_text": "", "digests": { "md5": "c34130a9c2e5aac3805c401bc1aaaeea", "sha256": "3fa9e82aa29659677dacee15c4b5886202ad98eeddfeaeae7f5faf7e893400a3" }, "downloads": -1, "filename": "pycryptoprosdk-0.1.3.tar.gz", "has_sig": false, "md5_digest": "c34130a9c2e5aac3805c401bc1aaaeea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9066, "upload_time": "2019-10-04T12:26:23", "url": "https://files.pythonhosted.org/packages/60/e3/1e408f3d5be0d9abab7bbbeb34dd279caadf4a2d5aa6988ab323b559fce7/pycryptoprosdk-0.1.3.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "55363ab61c58ba0059c0bd2a28fd4cd2", "sha256": "3aa110aec6d32350f6498118e7b727b3afbbee28e71495a0fadb9082f536d747" }, "downloads": -1, "filename": "pycryptoprosdk-0.1.5.tar.gz", "has_sig": false, "md5_digest": "55363ab61c58ba0059c0bd2a28fd4cd2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10306, "upload_time": "2019-10-04T15:18:07", "url": "https://files.pythonhosted.org/packages/b6/14/5ec9a3e9d9c59c30f7fa042df510cbfc671c2cffee92c4d5707aa989e01a/pycryptoprosdk-0.1.5.tar.gz" } ], "1.0.0-rc1": [ { "comment_text": "", "digests": { "md5": "47d35809bd08a2b2343efffb4abb22c3", "sha256": "0f6906a8f62426c4e0092e59d231fa5cec7eda2440f6feeb8106c90906f5713b" }, "downloads": -1, "filename": "pycryptoprosdk-1.0.0-rc1.tar.gz", "has_sig": false, "md5_digest": "47d35809bd08a2b2343efffb4abb22c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8620, "upload_time": "2019-10-07T12:37:15", "url": "https://files.pythonhosted.org/packages/77/fa/5fbd14bb544409780fe56364ca5619124c5d5cc6c798f80116d9bb4d866a/pycryptoprosdk-1.0.0-rc1.tar.gz" } ], "1.0.0-rc2": [ { "comment_text": "", "digests": { "md5": "0e3c61ffd6ee59324a996ef11192378c", "sha256": "850c0bc993c1af51a44662f7293387aaa2b28ba32005a12df881e55d0043b940" }, "downloads": -1, "filename": "pycryptoprosdk-1.0.0-rc2.tar.gz", "has_sig": false, "md5_digest": "0e3c61ffd6ee59324a996ef11192378c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8859, "upload_time": "2019-10-10T12:32:11", "url": "https://files.pythonhosted.org/packages/04/ab/bedb7dad49007f3e4fcf976908d75366a5c709a6f2b8f1c954e38bb0e5c3/pycryptoprosdk-1.0.0-rc2.tar.gz" } ], "1.0.0-rc3": [ { "comment_text": "", "digests": { "md5": "2964547354830a51cfe872e0a364b62c", "sha256": "2ad673cab4af832ac12d36b5a4193d72a4761981d0c52cf76eb3ab46849c14c0" }, "downloads": -1, "filename": "pycryptoprosdk-1.0.0-rc3.tar.gz", "has_sig": false, "md5_digest": "2964547354830a51cfe872e0a364b62c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8857, "upload_time": "2019-10-10T13:50:03", "url": "https://files.pythonhosted.org/packages/52/bb/3b289150c8348915d68fa1931daaf98f0cd92a4ef78a4c7db9a43fa2a6a5/pycryptoprosdk-1.0.0-rc3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "55363ab61c58ba0059c0bd2a28fd4cd2", "sha256": "3aa110aec6d32350f6498118e7b727b3afbbee28e71495a0fadb9082f536d747" }, "downloads": -1, "filename": "pycryptoprosdk-0.1.5.tar.gz", "has_sig": false, "md5_digest": "55363ab61c58ba0059c0bd2a28fd4cd2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10306, "upload_time": "2019-10-04T15:18:07", "url": "https://files.pythonhosted.org/packages/b6/14/5ec9a3e9d9c59c30f7fa042df510cbfc671c2cffee92c4d5707aa989e01a/pycryptoprosdk-0.1.5.tar.gz" } ] }