{ "info": { "author": "Pim van der Eijk, Ernst Jan van Nigtevecht", "author_email": "pvde@sonnenglanz.net, ejvn@sonnenglanz.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Programming Language :: Python" ], "description": "=======\nkeyinfo\n=======\n\nPython library to convert X.509 certificates to and from W3C XML Signature KeyInfo structures\n\n\nDescription\n===========\n\nThis library provides functionlity to convert X.509 certificates to and from W3C XML Signature \nKeyInfo structures. \n\nFor X.509, the module is based on the python \"cryptography\" module (which in turn is based on OpenSSL). \nThe keyinfo library converts to and from *cryptography.x509.certificate* objects. For XML, the module \nis based on the *lxml* library. (Future versions may also use the simpler \nElementTree library).\n\nIf you want to generate KeyInfo structures, your code needs to use existing functionality in that library \nto create certificates, or to load certificates in common file formats like PEM. The keyinfo module then\nallows you to convert these certificate objects to KeyInfo XML trees. Then, using the lxml library, you \ncan save those trees to file or otherwise process them. There first two export functions are the \nfollowing:\n\n- to_keyinfo_sig1 export to XML Signature version 1.0. In this case the issuer and serial number are provided.\n- to_keyinfo_sig11 exports to XML Signature version 1.1. In this case SHA256 and SHA512 X509 digests are provided. \n\nThese functions take either a certificate or a list of certificate objects representing a certificate chain as\nparameters.\n\nFrom version 0.4, ff the SHA3 library is availble, additionally SHA3-256 and SHA3-515 digests are provided.\n\nThe following code show how to load a certificate from a PEM format and save it as a KeyInfo XML file.\n\n.. code-block:: python\n\n from keyinfo import keyinfo\n from cryptography.x509 import load_pem_x509_certificate\n from cryptography.hazmat.backends import default_backend\n from lxml import etree\n\n # set infile, outfile\n with open(infile, 'r') as f:\n data = f.read()\n cert = load_pem_x509_certificate(data, default_backend())\n cert_xml = keyinfo.to_keyinfo_sig1(cert)\n fd = open(outfile,'w')\n fd.write(etree.tostring(cert_xml, pretty_print=True))\n fd.close()\n\nIt turns out the *load_pem_x509_certificate* actually only loads the first certificate. To load a chain\nfrom a PEM file, you can use *load_pem_x509_certificate_chain* from *keyinfo*.\n\n.. code-block:: python\n\n from keyinfo import keyinfo\n from lxml import etree\n\n # set infile, outfile\n with open(infile, 'r') as f:\n data = f.read()\n cert_list = keyinfo.load_pem_x509_certificate_chain(data)\n cert_xml = keyinfo.to_keyinfo_sig1(cert_list)\n fd = open(outfile,'w')\n fd.write(etree.tostring(cert_xml, pretty_print=True))\n fd.close()\n\n\nIf you want to parse KeyInfo structures, your code needs to parse the XML data using lxml. You can\nthen use the *from_keyinfo(keyinfo)* function to create a *cryptography.x509.certificate* object.\nFor backwards compatibility reasons, these functions return the first certificate only.\n\nTo load the full chain, you can an optional *chain* parameter, i.e. *from_keyinfo(keyinfo, chain=True)*.\nThe result then is a list of certificate objects.\n\n\n \n\n\nValidation\n==========\n\nWhen loading certificates from KeyInfo, some consistency checks are done between the X509Digest and \nX509Issuerserial element and the X509Certificate objects. If you want additional certificate validation,\nincluding path validation, you can use pyopenssl or wait for a future release of cryptography that will\nprovide this functionality.\n\nTests and Examples\n==================\n\nThe *tests* subdirectory has a complete test suite and *tests/data* has sample KeyInfo and PEM files \nused by the tests.\n\n\n\nVersion History\n===============\n\n0.9, 2017.01.12 Support for DSA keys\n\n0.8, 2017.01.08 Experimental support for elliptic curve keys; some open questions asked at cryptography-dev\n\n0.7, 2017.01.04 Bug fix, chain parameter not passed.\n\n0.6, 2016.12.30 Added support for Whirlpool, https://tools.ietf.org/html/rfc6931#section-2.1.4\n\n0.5, 2016.12.08 Added support for SHA1 for verification. (For generation, only SHA2 or SHA3 are used) \n\n0.4, 2016.12.07 SHA3 feature added\n\n0.3.*, 2016.10.09 Fixed README \n\n0.3, 2016.10.08. Support for certificate chains added.\n\n0.2, 2016.04.01. Provided readme, tests, examples, validation.\n\n0.1.3, 2016.03.27. First public Release.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://...", "keywords": "", "license": "mit", "maintainer": "", "maintainer_email": "", "name": "keyinfo", "package_url": "https://pypi.org/project/keyinfo/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/keyinfo/", "project_urls": { "Homepage": "http://..." }, "release_url": "https://pypi.org/project/keyinfo/0.9.1/", "requires_dist": null, "requires_python": "", "summary": "Python library to convert X.509 certificates to and from W3C XML Signature KeyInfo structures", "version": "0.9.1" }, "last_serial": 2569744, "releases": { "0.1.3": [ { "comment_text": "", "digests": { "md5": "4e7735e06d3f1d99ff6790a4e81abb51", "sha256": "ebe664b567e8c4b6f7c3bf0677cb3848699179f2cf1af5f3fa894ecc646b2973" }, "downloads": -1, "filename": "keyinfo-0.1.3.tar.gz", "has_sig": false, "md5_digest": "4e7735e06d3f1d99ff6790a4e81abb51", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19720, "upload_time": "2016-03-27T15:38:18", "url": "https://files.pythonhosted.org/packages/94/e8/7ed1ff1f0ced5b2870220040bcdceee648265fc672bf31986c56169d8e70/keyinfo-0.1.3.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "54d05a660cf4718fb8043c4729f077e2", "sha256": "9769d9d317c6a0964bcb13f05d57fa80e9bd21340ae889a91bc1d24ee2afacf2" }, "downloads": -1, "filename": "keyinfo-0.2.tar.gz", "has_sig": false, "md5_digest": "54d05a660cf4718fb8043c4729f077e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27916, "upload_time": "2016-04-02T10:34:37", "url": "https://files.pythonhosted.org/packages/3a/63/b71dea72935a4018941d5ee0dd18f1a2dbf9d1361aa005e23b2acf1554e2/keyinfo-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "59482b03ae84ec01f2b613b5cfe27bfe", "sha256": "e1c1821d25fd861faf3b97519b480c404443d61502ebad9e9403a985be1038a2" }, "downloads": -1, "filename": "keyinfo-0.3.tar.gz", "has_sig": false, "md5_digest": "59482b03ae84ec01f2b613b5cfe27bfe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28778, "upload_time": "2016-10-08T10:20:56", "url": "https://files.pythonhosted.org/packages/e5/99/2ec552ac4d3a5920c018a256d649cd703b0f4a80b7e11d711cfff1f8b220/keyinfo-0.3.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "b7f06f48de6851d963f10f26f037ad44", "sha256": "d0015afd0667de0a6128cf9102a557495c498d2f667471f34418550a00b49076" }, "downloads": -1, "filename": "keyinfo-0.3.3.tar.gz", "has_sig": false, "md5_digest": "b7f06f48de6851d963f10f26f037ad44", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28796, "upload_time": "2016-10-09T08:57:27", "url": "https://files.pythonhosted.org/packages/74/87/6a630b8c976141e77e15db396382a94b3351687391fdb6c6c0b2e7f53f84/keyinfo-0.3.3.tar.gz" } ], "0.3.5": [ { "comment_text": "", "digests": { "md5": "dab62de1842d573584c7644ff1e90526", "sha256": "3bfba58d20f22129d43b52a2314272e13bb323c687e45a079ad0dec2c64fec19" }, "downloads": -1, "filename": "keyinfo-0.3.5.tar.gz", "has_sig": false, "md5_digest": "dab62de1842d573584c7644ff1e90526", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28812, "upload_time": "2016-10-09T09:05:29", "url": "https://files.pythonhosted.org/packages/46/d8/3eed79fcc9584c17a6d816335d7102d8d07a590fc7903c51587d631209e8/keyinfo-0.3.5.tar.gz" } ], "0.3.6": [ { "comment_text": "", "digests": { "md5": "d4453ccfc23e9eddc174f61908195667", "sha256": "04276f40ad63c2f3ee287f6f4cd3554a8f7794a9e9780e275491f44e636cec0d" }, "downloads": -1, "filename": "keyinfo-0.3.6.tar.gz", "has_sig": false, "md5_digest": "d4453ccfc23e9eddc174f61908195667", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28807, "upload_time": "2016-10-09T09:13:08", "url": "https://files.pythonhosted.org/packages/2c/7d/07d527f0160b29038556387d6810aa5fe3336654e0e3315c7e21097f8da6/keyinfo-0.3.6.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "b2679cb2f6e99614a611fc4bbe5c4dc5", "sha256": "dbabd1e3e3749f10bbc98ed170503c401d4df7316823330b0915653d38496e64" }, "downloads": -1, "filename": "keyinfo-0.4.2.tar.gz", "has_sig": false, "md5_digest": "b2679cb2f6e99614a611fc4bbe5c4dc5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29017, "upload_time": "2016-12-07T16:09:17", "url": "https://files.pythonhosted.org/packages/28/95/4e8b03f0bcd606c77df3c1c59fe18169f8ef67d756654646bc6ab14473ca/keyinfo-0.4.2.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "e0c09d014beb424cad20b166d3168bad", "sha256": "fc884897ea60c0644615ac7d0b9c4a2ced4354232cae575d4de57839820ee813" }, "downloads": -1, "filename": "keyinfo-0.5.tar.gz", "has_sig": false, "md5_digest": "e0c09d014beb424cad20b166d3168bad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29339, "upload_time": "2016-12-08T08:31:30", "url": "https://files.pythonhosted.org/packages/bc/98/2749b2570fb6c1a30d77a5f7ea839bb1649fd579691bea90a799423c61d1/keyinfo-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "166cdc497567cf0d058282c776f59f19", "sha256": "bef8257c4b2ef873d6e7b7d01841499a879004f0d55a202d609359bcbff60b40" }, "downloads": -1, "filename": "keyinfo-0.6.tar.gz", "has_sig": false, "md5_digest": "166cdc497567cf0d058282c776f59f19", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29445, "upload_time": "2016-12-30T12:04:35", "url": "https://files.pythonhosted.org/packages/3a/18/04beeaa4c3852261e83b0ebee6b288a45464296a959652438511d8b03a11/keyinfo-0.6.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "eb015e409072357039bb0c66d4b6dec7", "sha256": "d32a9daf10729e342611e7966284afe26426960240ec2f96933a9fa0f4cc3cbe" }, "downloads": -1, "filename": "keyinfo-0.7.1.tar.gz", "has_sig": false, "md5_digest": "eb015e409072357039bb0c66d4b6dec7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29475, "upload_time": "2017-01-04T15:37:20", "url": "https://files.pythonhosted.org/packages/72/ad/2af8e50616e1588542925f7bf34d882fb241f82097fcc7bf59ba35a8f454/keyinfo-0.7.1.tar.gz" } ], "0.8": [ { "comment_text": "", "digests": { "md5": "77de73844a5b6c8af4c6bc05ec3ebf3e", "sha256": "822a062fda7ca365e76797d288324b8ec74315b87a22d69ee0bfaff9b27cbed3" }, "downloads": -1, "filename": "keyinfo-0.8.tar.gz", "has_sig": false, "md5_digest": "77de73844a5b6c8af4c6bc05ec3ebf3e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29636, "upload_time": "2017-01-09T08:59:56", "url": "https://files.pythonhosted.org/packages/8a/e0/793d3ef93986f8b5ae171c8f4b6336a4fe98472c582bfbfe84e1e5bf7d94/keyinfo-0.8.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "535c16fb100d0f9eca2d0b5a10abf98e", "sha256": "0a2a0a6194e13602ba10d2963c3cfbdd9f37abc1ba5807533a3f414ca7bc811e" }, "downloads": -1, "filename": "keyinfo-0.9.1.tar.gz", "has_sig": false, "md5_digest": "535c16fb100d0f9eca2d0b5a10abf98e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29964, "upload_time": "2017-01-12T13:36:14", "url": "https://files.pythonhosted.org/packages/e9/cf/a06f22cc2f2cb66ab0e876e80eb002b532aa87d54d3f08850512b890099c/keyinfo-0.9.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "535c16fb100d0f9eca2d0b5a10abf98e", "sha256": "0a2a0a6194e13602ba10d2963c3cfbdd9f37abc1ba5807533a3f414ca7bc811e" }, "downloads": -1, "filename": "keyinfo-0.9.1.tar.gz", "has_sig": false, "md5_digest": "535c16fb100d0f9eca2d0b5a10abf98e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29964, "upload_time": "2017-01-12T13:36:14", "url": "https://files.pythonhosted.org/packages/e9/cf/a06f22cc2f2cb66ab0e876e80eb002b532aa87d54d3f08850512b890099c/keyinfo-0.9.1.tar.gz" } ] }