rfc3161ng


Namerfc3161ng JSON
Version 2.1.3 PyPI version JSON
download
home_pagehttps://dev.entrouvert.org/projects/python-rfc3161
SummaryPython implementation of the RFC3161 specification, using pyasn1
upload_time2020-10-30 14:38:29
maintainertrbs
docs_urlNone
authorBenjamin Dauvergne
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =========
rfc3161ng
=========

.. image:: https://img.shields.io/pypi/l/rfc3161ng.svg
   :target: https://raw.githubusercontent.com/trbs/rfc3161ng/master/LICENSE

.. image:: https://github.com/trbs/rfc3161ng/workflows/CI/badge.svg?branch=master
     :target: https://github.com/trbs/rfc3161ng/actions?workflow=CI
     :alt: CI Status

.. image:: https://img.shields.io/pypi/v/rfc3161ng.svg
    :target: https://pypi.python.org/pypi/rfc3161ng/
    :alt: Latest PyPI version

.. image:: https://img.shields.io/pypi/wheel/rfc3161ng.svg
    :target: https://pypi.python.org/pypi/rfc3161ng/
    :alt: Supports Wheel format

A simple client library for cryptographic timestamping service implementing the
protocol from RFC3161.

This started as a fork of https://dev.entrouvert.org/projects/python-rfc3161 and
has some additional patches such as Python3 support.

The latest version of this library is available from
https://github.com/trbs/rfc3161ng/ .


Public providers
================

There are several timestamping services around.  Here is a list of
publicly available services you can try:

 * http://freetsa.org/tsr
 * http://time.certum.pl
 * http://timestamp.comodoca.com/rfc3161
 * http://timestamp.geotrust.com/tsa
 * http://timestamp.globalsign.com/scripts/timstamp.dll
 * http://tsa.starfieldtech.com
 * https://teszt.e-szigno.hu:440/tsa

Example
=======

    >>> import rfc3161ng
    >>> certificate = open('data/certum_certificate.crt', 'rb').read()
    >>> rt = rfc3161ng.RemoteTimestamper('http://time.certum.pl', certificate=certificate)
    >>> tst = rt.timestamp(data=b'John Doe')
    >>> rt.check(tst, data=b'John Doe')
    True
    >>> rfc3161ng.get_timestamp(tst)
    datetime.datetime(2017, 8, 31, 15, 42, 58, tzinfo=tzutc())

Example for a server that insist on SHA256:

    >> import rfc3161ng
    >> timestamper = rfc3161ng.RemoteTimestamper('https://interop.redwax.eu/test/timestamp', hashname='sha256')
    >> tsr = timestamper(data=b'The RedWax Project', return_tsr=True)
    >> print('{}'.format(tsr))

Verifying timestamp using OpenSSL
=================================

One can verify the timestamp returned by the timeserver by using OpenSSL.
For example with:

  $ openssl ts -verify -data data_file.txt -in data_file.tsr -CAfile cacert.pem -untrusted tsa.crt

To save the tsr you can use code similar to:

    >>> from pyasn1.codec.der import encoder
    >>> import rfc3161ng
    >>> ...
    >>> timestamper = rfc3161ng.RemoteTimestamper('http://freetsa.org/tsr', certificate=certificate_data)
    >>> tsr = timestamper(data=data_file.read(), return_tsr=True)
    >>> with open("data_file.tsr", "wb") as f:
    >>>     f.write(encoder.encode(tsr))

Alternatively you can just save the raw `response.content` returned from the certification server.

There is a test which also covers this in `test_verify_timestamp_response_with_openssl`.


Authors
=======

 * Benjamin Dauvergne <bdauvergne@entrouvert.com>
 * Michael Gebetsroither <michael@mgeb.org>
 * Bas van Oostveen <trbs@trbs.net>



            

Raw data

            {
    "_id": null,
    "home_page": "https://dev.entrouvert.org/projects/python-rfc3161",
    "name": "rfc3161ng",
    "maintainer": "trbs",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "trbs@trbs.net",
    "keywords": "",
    "author": "Benjamin Dauvergne",
    "author_email": "bdauvergne@entrouvert.com",
    "download_url": "https://files.pythonhosted.org/packages/87/ab/7b1cc11019fb63d9420093ed9ff339ea544d0158141ac0daf33961a200cf/rfc3161ng-2.1.3.tar.gz",
    "platform": "any",
    "description": "=========\nrfc3161ng\n=========\n\n.. image:: https://img.shields.io/pypi/l/rfc3161ng.svg\n   :target: https://raw.githubusercontent.com/trbs/rfc3161ng/master/LICENSE\n\n.. image:: https://github.com/trbs/rfc3161ng/workflows/CI/badge.svg?branch=master\n     :target: https://github.com/trbs/rfc3161ng/actions?workflow=CI\n     :alt: CI Status\n\n.. image:: https://img.shields.io/pypi/v/rfc3161ng.svg\n    :target: https://pypi.python.org/pypi/rfc3161ng/\n    :alt: Latest PyPI version\n\n.. image:: https://img.shields.io/pypi/wheel/rfc3161ng.svg\n    :target: https://pypi.python.org/pypi/rfc3161ng/\n    :alt: Supports Wheel format\n\nA simple client library for cryptographic timestamping service implementing the\nprotocol from RFC3161.\n\nThis started as a fork of https://dev.entrouvert.org/projects/python-rfc3161 and\nhas some additional patches such as Python3 support.\n\nThe latest version of this library is available from\nhttps://github.com/trbs/rfc3161ng/ .\n\n\nPublic providers\n================\n\nThere are several timestamping services around.  Here is a list of\npublicly available services you can try:\n\n * http://freetsa.org/tsr\n * http://time.certum.pl\n * http://timestamp.comodoca.com/rfc3161\n * http://timestamp.geotrust.com/tsa\n * http://timestamp.globalsign.com/scripts/timstamp.dll\n * http://tsa.starfieldtech.com\n * https://teszt.e-szigno.hu:440/tsa\n\nExample\n=======\n\n    >>> import rfc3161ng\n    >>> certificate = open('data/certum_certificate.crt', 'rb').read()\n    >>> rt = rfc3161ng.RemoteTimestamper('http://time.certum.pl', certificate=certificate)\n    >>> tst = rt.timestamp(data=b'John Doe')\n    >>> rt.check(tst, data=b'John Doe')\n    True\n    >>> rfc3161ng.get_timestamp(tst)\n    datetime.datetime(2017, 8, 31, 15, 42, 58, tzinfo=tzutc())\n\nExample for a server that insist on SHA256:\n\n    >> import rfc3161ng\n    >> timestamper = rfc3161ng.RemoteTimestamper('https://interop.redwax.eu/test/timestamp', hashname='sha256')\n    >> tsr = timestamper(data=b'The RedWax Project', return_tsr=True)\n    >> print('{}'.format(tsr))\n\nVerifying timestamp using OpenSSL\n=================================\n\nOne can verify the timestamp returned by the timeserver by using OpenSSL.\nFor example with:\n\n  $ openssl ts -verify -data data_file.txt -in data_file.tsr -CAfile cacert.pem -untrusted tsa.crt\n\nTo save the tsr you can use code similar to:\n\n    >>> from pyasn1.codec.der import encoder\n    >>> import rfc3161ng\n    >>> ...\n    >>> timestamper = rfc3161ng.RemoteTimestamper('http://freetsa.org/tsr', certificate=certificate_data)\n    >>> tsr = timestamper(data=data_file.read(), return_tsr=True)\n    >>> with open(\"data_file.tsr\", \"wb\") as f:\n    >>>     f.write(encoder.encode(tsr))\n\nAlternatively you can just save the raw `response.content` returned from the certification server.\n\nThere is a test which also covers this in `test_verify_timestamp_response_with_openssl`.\n\n\nAuthors\n=======\n\n * Benjamin Dauvergne <bdauvergne@entrouvert.com>\n * Michael Gebetsroither <michael@mgeb.org>\n * Bas van Oostveen <trbs@trbs.net>\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python implementation of the RFC3161 specification, using pyasn1",
    "version": "2.1.3",
    "project_urls": {
        "Homepage": "https://dev.entrouvert.org/projects/python-rfc3161"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6c66cf13725b4ad06527ca482c99202a683ca3b35586eec9bad5f9e19efb43b9",
                "md5": "7d54c9751072f9cb36e77b36259d477f",
                "sha256": "81fe7e4488f523c758b1206bf5e72ba2066b78f2812107b1b7bb16a7596e524b"
            },
            "downloads": -1,
            "filename": "rfc3161ng-2.1.3-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7d54c9751072f9cb36e77b36259d477f",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 9949,
            "upload_time": "2020-10-30T14:38:26",
            "upload_time_iso_8601": "2020-10-30T14:38:26.277536Z",
            "url": "https://files.pythonhosted.org/packages/6c/66/cf13725b4ad06527ca482c99202a683ca3b35586eec9bad5f9e19efb43b9/rfc3161ng-2.1.3-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "87ab7b1cc11019fb63d9420093ed9ff339ea544d0158141ac0daf33961a200cf",
                "md5": "f127d923a78e63ddcf4c060608faf4b3",
                "sha256": "1e88614da61b22abd591577f9dd39d3a030335f9e8a12d8bc001149c17d0a01e"
            },
            "downloads": -1,
            "filename": "rfc3161ng-2.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "f127d923a78e63ddcf4c060608faf4b3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 22418,
            "upload_time": "2020-10-30T14:38:29",
            "upload_time_iso_8601": "2020-10-30T14:38:29.046781Z",
            "url": "https://files.pythonhosted.org/packages/87/ab/7b1cc11019fb63d9420093ed9ff339ea544d0158141ac0daf33961a200cf/rfc3161ng-2.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-10-30 14:38:29",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "rfc3161ng"
}
        
Elapsed time: 0.77157s