endesive:基于 Python 的数字签名与验证工具库项目

en-crypt, de-crypt, si-gn, ve-rify - smime, pdf, xades and plain files in pure python

Branch2Tags47
FilesLast commitLast update
2 months ago
2 months ago
2 months ago
2 months ago
1 year ago
8 years ago
6 years ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago

.. image:: https://img.shields.io/pypi/v/endesive.svg :target: https://pypi.python.org/pypi/endesive

Description

Python library for digital signing and verification of digital signatures in mail, PDF and XML documents.

The ASN.1 implementation depends on asn1crypto. Cryptographic routines depends on cryptography library.

For certificate verification cryptography_ library is used.

This library implements S/MIME handler which can encrypt and decrypt S/MIME messages using a public RSA key, in AES-128/192/256 CBC/OFB modes. It can also sign and verify S/MIME messages.

This library implements CAdES-B handler for signing and verifying PDF documents in Adobe.PPKLite/adbe.pkcs7.detached form. It can also sign documents generated by external programms.

This library implements XADES BES/T with enveloped and enveloping format for creating signed xml files.

This library implements CMS handler for signing and verifying plain text files with detached signature files.

License

This software is licensed under the MIT License. See the LICENSE file in the top distribution directory for the full license text.

Requirements

  • Python 3.*
  • cryptography_
  • asn1crypto_
  • lxml_
  • pykcs11_
  • Pillow_
  • pypdf_
  • attrs_

Examples

make-cert-ca.py Create required certificates (password is 1234) make-cert-hsm.py Create required certificates for SoftHSM (password is secret1) make-pdf.py Create simple two paged PDF document which is used in pdf-*.py examples. make-pdf-*.py Create other *.pdf files used in pdf-*.py examples make-plain.py Create simple UTF-8 text file for use in plain-*.py examples. make-smime.py Create simple UTF-8 text file for use in smime-*.py examples. make-xml.py Create simple xml file for use in xml-*.py examples.

pdf-sign-cms.py Create signature in externally created PDF. pdf-sign-cms-hsm.py Create signature in externally created PDF but signed with key stored in SoftHSM. pdf-sign-fpdf.py Create signature while creating PDF. pdf-verify.py Verify prevously generated files (cms/pdf).

plain-openssl.sh Sign, encrypt and decrypt text file with help of openssl executable. plain-sign-attr.py Sign text file with 'extended' CMS attributes. plain-sign-noattr.py Sign text file without 'extended' CMS attributes. plain-verify.py Verify all generated signatures for text file.

smime-openssl.sh Create signed S/MIME file, encrypted S/MIME file and decrypt generated S/MIME file with help of openssl executable. smime-encrypt.py Create encrypted S/MIME file. smime-decrypt.py Decrypt encrypted S/MIME file. smime-sign-attr.py Create signed S/MIME file with 'extended' CMS attributes. smime-sign-noattr.py Create signed S/MIME file without 'extended' CMS attributes. smime-verify.py Verify all generated S/MIME files.

xml-hsm-certum-enveloped.py XADES enveloped mode with real certificate (BES/T). xml-hsm-certum-enveloping.py XADES enveloping mode with real certificate (BES/T). xml-hsm-softhsm2-enveloped.py XADES enveloped mode with SoftHSM certificate (BES). xml-hsm-softhsm2-enveloping.py XADES enveloping mode with SoftHSM certificate (BES).

Tools

Online pdf validator pdfvalidator_ or verapdf. Offline Apache pdfbox java based validator.

Validate electronic signatures: ec_europa_ or pkitools_net_.

.. _cryptography: https://github.com/pyca/cryptography .. _asn1crypto: https://github.com/wbond/asn1crypto .. _lxml: https://pypi.org/project/lxml/ .. _pykcs11: https://pypi.org/project/pykcs11/ .. _Pillow: https://pypi.org/project/Pillow/ .. _pypdf: https://github.com/py-pdf/pypdf .. _attrs: https://github.com/python-attrs/attrs .. _pdfvalidator: https://www.pdf-online.com/osa/validate.aspx .. _verapdf: https://demo.verapdf.org/ .. _pdfbox: https://pdfbox.apache.org/ .. _ec_europa: https://ec.europa.eu/cefdigital/DSS/webapp-demo/validation .. _pkitools_net: https://pkitools.net/pages/validator/pdf.html

Introduction

en-crypt, de-crypt, si-gn, ve-rify - smime, pdf, xades and plain files in pure python

Customize your domain
11278103Visit GitHub