Django Endesive
Django endesive PDF digital signing utility. This package allows you to digitally sign a PDF document from your Django application. It is based on https://github.com/m32/endesive
In order to digitally sign your pdf documents you will need a valid p12 / pfx certificate. You can use a self-signed certificate for testing purposes but you should aquire a certificate from a Certificate Authority for production.
Special PDF certificates issued by partners on the AATL (Adobe Approved Trust List).
Documentation
The full documentation is at https://django-endesive.readthedocs.io.
Quickstart
Install Django Endesive:
pip install django-endesive
Add it to your INSTALLED_APPS:
INSTALLED_APPS = (
...
'django_endesive.apps.DjangoEndesiveConfig',
...
)
Add the following to your setup to your settings.py file:
DJANGO_ENDESIVE = {
'PDF_CERTIFICATE_PATH': 'required: /path/to/your/certificate',
'PDF_CERTIFICATE_PASSWORD': 'optional: certificate password if applicable',
'PDF_ATTRIBUTES': {
'CONTACT': 'optional: <you@example.com>',
'LOCATION': 'optional: <your location>',
'REASON': 'optional: <Reason for Document validation>'
}
}
Here is a rather contrived example of how you would sign your pdf:
from django_endesive import pdf
from endesive.pdf import fpdf
# Generate a pdf file (this could be any file already generated by your app)
doc = fpdf.FPDF()
doc.add_page()
doc.set_font('helvetica', '', 13.0)
doc.cell(w=75.0, h=22.0, align='C',
txt='Hello, world page=1.', border=0, ln=0)
doc.output('./pdf.pdf', "F")
# Open file and feed bytes to the sign function
pdf_bytes = open('./pdf.pdf', 'rb').read()
signed_pdf = pdf.sign(pdf_bytes=pdf_bytes)
# signed_pdf bytes can now be written to a bytestream in memory or saved to a file on disk
Running Tests
Does the code actually work?
source <YOURVIRTUALENV>/bin/activate (myenv) $ pip install tox (myenv) $ tox
Credits
Tools used in rendering this package:
History
0.1.0 (2018-12-04)
First release on PyPI.
0.2.0 (2019-12-24)
All certificates passphrases are now bytes (As per deprecation warning).
Added support and tests to include Django 2.1 - 3.0
Added support and tests to include Python 3.7 - 3.8
PEP8 formatting errors
Metadata
Release files for django-endesive 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| django-endesive-0.2.0.tar.gz | 6.9 kB | Without provenance | Details |
Release files / django-endesive-0.2.0.tar.gz
| Download URL | django-endesive-0.2.0.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55efeece8fbe72001244ddc83db8f708888af2ffa3543e7bcdb0059fb7110cb9
|
|
BLAKE2b-256 checksum How to use checksums |
ad5b3a3b4e2fcfc31070dbfa41e16533e0b947cb00acdc12d1ea14b6665ff520
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.7
|
Security for django-endesive 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.