pyHanko


NamepyHanko JSON
Version 0.23.2 PyPI version JSON
download
home_pageNone
SummaryTools for stamping and signing PDF files
upload_time2024-03-25 07:13:42
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords signature pdf pades digital-signature pkcs11
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            ![pyHanko](docs/images/pyhanko-logo.svg)

![status](https://github.com/MatthiasValvekens/pyHanko/workflows/pytest/badge.svg)
![Codecov](https://img.shields.io/codecov/c/github/MatthiasValvekens/pyHanko)
![pypi](https://img.shields.io/pypi/v/pyHanko.svg)



The lack of open-source CLI tooling to handle digitally signing and stamping PDF files was bothering me, so I went ahead and rolled my own.

*Note:* The working title of this project (and former name of the repository on GitHub) was `pdf-stamp`, which might still linger in some references.

*Note:* This project is currently in beta, and not yet production-ready.

### Documentation

The [documentation for pyHanko is hosted on ReadTheDocs](https://pyhanko.readthedocs.io/en/latest/)
and includes information on CLI usage, library usage, and API reference documentation derived from
inline docstrings.

### Installing

PyHanko is hosted on [PyPI](https://pypi.org/project/pyHanko/),
and can be installed using `pip`:

```bash
pip install 'pyHanko[pkcs11,image-support,opentype,xmp]'
```

Depending on your shell, you might have to leave off the quotes:

```bash
pip install pyHanko[pkcs11,image-support,opentype,xmp]
```

This `pip` invocation includes the optional dependencies required for PKCS#11, image handling and
OpenType/TrueType support.

PyHanko requires Python 3.8 or later.

### Contributing

Do you have a question about pyHanko?
[Post it on the discussion forum][discussion-forum]!

This project welcomes community contributions. If there's a feature you'd like
to have implemented, a bug you want to report, or if you're keen on
contributing in some other way: that's great! However, please make sure to
review the [contribution guidelines](CONTRIBUTING.md) before making your
contribution. When in doubt, [ask for help on the discussion board][discussion-forum].

**Please do not ask for support on the issue tracker.** The issue tracker is for bug
reports and actionable feature requests. Questions related to pyHanko usage
and development should be asked in the [discussion forum][discussion-forum] instead.


[discussion-forum]: https://github.com/MatthiasValvekens/pyHanko/discussions


### Features

The code in this repository functions both as a library and as a command-line tool.
It's nowhere near complete, but here is a short overview of the features.
Note that not all of these are necessarily exposed through the CLI.

 - Stamping
    - Simple text-based stamps
    - QR stamps
    - Font can be monospaced, or embedded from a TTF/OTF font (requires `[opentype]` optional deps)
 - Document preparation 
    - Add empty signature fields to existing PDFs
    - Add seed values to signature fields, with or without constraints
    - Manage document metadata
 - Signing
    * Option to use async signing API
    - Signatures can be invisible, or with an appearance based on the stamping tools
    - LTV-enabled signatures are supported
        - PAdES baseline profiles B-B, B-T, B-LT and B-LTA are all supported.
        - Adobe-style revocation info embedding is also supported.
    - RFC 3161 timestamp server support
    - Support for multiple signatures (all modifications are executed using incremental updates to 
      preserve cryptographic integrity)
    - Supports RSA, DSA, ECDSA and EdDSA
      - RSA padding modes: PKCS#1 v1.5 and RSASSA-PSS
      - DSA
      - ECDSA curves: anything supported by the `cryptography` library, 
        see [here](https://cryptography.io/en/latest/hazmat/primitives/asymmetric/ec/#elliptic-curves).
      - EdDSA: both Ed25519 and Ed448 are supported (in "pure" mode only, as per RFC 8419)
    - Built-in support for PDF extensions defined in ISO/TS 32001 and ISO/TS 32002.
    - PKCS#11 support
        - Available both from the library and through the CLI
        - Extra convenience wrapper for Belgian eID cards
    - "Interrupted signing" mode for ease of integration with remote and/or interactive signing
      processes.
 - Signature validation
    - Cryptographic integrity check
    - Authentication through X.509 chain of trust validation
    - LTV validation/sanity check (ad hoc)
    - Difference analysis on files with multiple signatures and/or incremental 
      updates made after signing (experimental)
    - Signature seed value constraint validation
    - AdES validation (incubating)
 - Encryption
    - All encryption methods in PDF 2.0 are supported.
    - In addition, we support a number of extra file encryption
      modes of operation for the public-key security handler that are not
      explicitly called out in the standard.
         - RSAES-OAEP (does not appear to be widely supported in PDF tooling)
         - ephemeral-static ECDH with X9.63 key derivation (supported by Acrobat)
 - CLI & configuration
    - YAML-based configuration (optional for most features)
    - CLI based on `click` 
        - Available as `pyhanko` (when installed) or `python -m pyhanko` when running from
          the source directory
        - Built-in help: run `pyhanko --help` to get started


### Some TODOs and known limitations

See the [known issues](https://pyhanko.readthedocs.io/en/latest/known-issues.html)
page in the documentation.


### Acknowledgement

This repository includes code from `PyPDF2` (with both minor and major modifications); the original license has been included [here](pyhanko/pdf_utils/LICENSE.PyPDF2).


## License

MIT License, see [LICENSE](LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyHanko",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Matthias Valvekens <dev@mvalvekens.be>",
    "keywords": "signature, pdf, pades, digital-signature, pkcs11",
    "author": null,
    "author_email": "Matthias Valvekens <dev@mvalvekens.be>",
    "download_url": "https://files.pythonhosted.org/packages/5d/1a/b432547775133cf9c810f31ac4f14652882fc3814fbe54265ea3b55941ee/pyHanko-0.23.2.tar.gz",
    "platform": null,
    "description": "![pyHanko](docs/images/pyhanko-logo.svg)\n\n![status](https://github.com/MatthiasValvekens/pyHanko/workflows/pytest/badge.svg)\n![Codecov](https://img.shields.io/codecov/c/github/MatthiasValvekens/pyHanko)\n![pypi](https://img.shields.io/pypi/v/pyHanko.svg)\n\n\n\nThe lack of open-source CLI tooling to handle digitally signing and stamping PDF files was bothering me, so I went ahead and rolled my own.\n\n*Note:* The working title of this project (and former name of the repository on GitHub) was `pdf-stamp`, which might still linger in some references.\n\n*Note:* This project is currently in beta, and not yet production-ready.\n\n### Documentation\n\nThe [documentation for pyHanko is hosted on ReadTheDocs](https://pyhanko.readthedocs.io/en/latest/)\nand includes information on CLI usage, library usage, and API reference documentation derived from\ninline docstrings.\n\n### Installing\n\nPyHanko is hosted on [PyPI](https://pypi.org/project/pyHanko/),\nand can be installed using `pip`:\n\n```bash\npip install 'pyHanko[pkcs11,image-support,opentype,xmp]'\n```\n\nDepending on your shell, you might have to leave off the quotes:\n\n```bash\npip install pyHanko[pkcs11,image-support,opentype,xmp]\n```\n\nThis `pip` invocation includes the optional dependencies required for PKCS#11, image handling and\nOpenType/TrueType support.\n\nPyHanko requires Python 3.8 or later.\n\n### Contributing\n\nDo you have a question about pyHanko?\n[Post it on the discussion forum][discussion-forum]!\n\nThis project welcomes community contributions. If there's a feature you'd like\nto have implemented, a bug you want to report, or if you're keen on\ncontributing in some other way: that's great! However, please make sure to\nreview the [contribution guidelines](CONTRIBUTING.md) before making your\ncontribution. When in doubt, [ask for help on the discussion board][discussion-forum].\n\n**Please do not ask for support on the issue tracker.** The issue tracker is for bug\nreports and actionable feature requests. Questions related to pyHanko usage\nand development should be asked in the [discussion forum][discussion-forum] instead.\n\n\n[discussion-forum]: https://github.com/MatthiasValvekens/pyHanko/discussions\n\n\n### Features\n\nThe code in this repository functions both as a library and as a command-line tool.\nIt's nowhere near complete, but here is a short overview of the features.\nNote that not all of these are necessarily exposed through the CLI.\n\n - Stamping\n    - Simple text-based stamps\n    - QR stamps\n    - Font can be monospaced, or embedded from a TTF/OTF font (requires `[opentype]` optional deps)\n - Document preparation \n    - Add empty signature fields to existing PDFs\n    - Add seed values to signature fields, with or without constraints\n    - Manage document metadata\n - Signing\n    * Option to use async signing API\n    - Signatures can be invisible, or with an appearance based on the stamping tools\n    - LTV-enabled signatures are supported\n        - PAdES baseline profiles B-B, B-T, B-LT and B-LTA are all supported.\n        - Adobe-style revocation info embedding is also supported.\n    - RFC 3161 timestamp server support\n    - Support for multiple signatures (all modifications are executed using incremental updates to \n      preserve cryptographic integrity)\n    - Supports RSA, DSA, ECDSA and EdDSA\n      - RSA padding modes: PKCS#1 v1.5 and RSASSA-PSS\n      - DSA\n      - ECDSA curves: anything supported by the `cryptography` library, \n        see [here](https://cryptography.io/en/latest/hazmat/primitives/asymmetric/ec/#elliptic-curves).\n      - EdDSA: both Ed25519 and Ed448 are supported (in \"pure\" mode only, as per RFC 8419)\n    - Built-in support for PDF extensions defined in ISO/TS 32001 and ISO/TS 32002.\n    - PKCS#11 support\n        - Available both from the library and through the CLI\n        - Extra convenience wrapper for Belgian eID cards\n    - \"Interrupted signing\" mode for ease of integration with remote and/or interactive signing\n      processes.\n - Signature validation\n    - Cryptographic integrity check\n    - Authentication through X.509 chain of trust validation\n    - LTV validation/sanity check (ad hoc)\n    - Difference analysis on files with multiple signatures and/or incremental \n      updates made after signing (experimental)\n    - Signature seed value constraint validation\n    - AdES validation (incubating)\n - Encryption\n    - All encryption methods in PDF 2.0 are supported.\n    - In addition, we support a number of extra file encryption\n      modes of operation for the public-key security handler that are not\n      explicitly called out in the standard.\n         - RSAES-OAEP (does not appear to be widely supported in PDF tooling)\n         - ephemeral-static ECDH with X9.63 key derivation (supported by Acrobat)\n - CLI & configuration\n    - YAML-based configuration (optional for most features)\n    - CLI based on `click` \n        - Available as `pyhanko` (when installed) or `python -m pyhanko` when running from\n          the source directory\n        - Built-in help: run `pyhanko --help` to get started\n\n\n### Some TODOs and known limitations\n\nSee the [known issues](https://pyhanko.readthedocs.io/en/latest/known-issues.html)\npage in the documentation.\n\n\n### Acknowledgement\n\nThis repository includes code from `PyPDF2` (with both minor and major modifications); the original license has been included [here](pyhanko/pdf_utils/LICENSE.PyPDF2).\n\n\n## License\n\nMIT License, see [LICENSE](LICENSE).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Tools for stamping and signing PDF files",
    "version": "0.23.2",
    "project_urls": {
        "Changes": "https://pyhanko.readthedocs.io/en/latest/changelog.html",
        "Documentation": "https://pyhanko.readthedocs.io/",
        "Homepage": "https://github.com/MatthiasValvekens/pyHanko",
        "Issue Tracker": "https://github.com/MatthiasValvekens/pyHanko/issues",
        "Source Code": "https://github.com/MatthiasValvekens/pyHanko"
    },
    "split_keywords": [
        "signature",
        " pdf",
        " pades",
        " digital-signature",
        " pkcs11"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c1044f60c6e94be96da43b050666ab17960de36e798bb6eb9ee4c6c061880b16",
                "md5": "a3f215ad8a1639b31d8ff96f52fae62a",
                "sha256": "f5406fa15ac11b0a4e36de082bde95d4ada0237ee974b9a7e6a777613b909e6d"
            },
            "downloads": -1,
            "filename": "pyHanko-0.23.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a3f215ad8a1639b31d8ff96f52fae62a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 432260,
            "upload_time": "2024-03-25T07:13:39",
            "upload_time_iso_8601": "2024-03-25T07:13:39.850421Z",
            "url": "https://files.pythonhosted.org/packages/c1/04/4f60c6e94be96da43b050666ab17960de36e798bb6eb9ee4c6c061880b16/pyHanko-0.23.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5d1ab432547775133cf9c810f31ac4f14652882fc3814fbe54265ea3b55941ee",
                "md5": "d109086916d76c28e039b5b314824ead",
                "sha256": "01d0d0b667dde055b3c3ae3134e0af7d7a3e687035dcf08f8078f64ea40453e5"
            },
            "downloads": -1,
            "filename": "pyHanko-0.23.2.tar.gz",
            "has_sig": false,
            "md5_digest": "d109086916d76c28e039b5b314824ead",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 375463,
            "upload_time": "2024-03-25T07:13:42",
            "upload_time_iso_8601": "2024-03-25T07:13:42.031182Z",
            "url": "https://files.pythonhosted.org/packages/5d/1a/b432547775133cf9c810f31ac4f14652882fc3814fbe54265ea3b55941ee/pyHanko-0.23.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-25 07:13:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MatthiasValvekens",
    "github_project": "pyHanko",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "pyhanko"
}
        
Elapsed time: 0.22940s