Skip to main content

python-smime-email

PyPI Downloads

Generate x509 SMIME signed emails with ease!

Usage

  1. Generate the email raw content

    import smime_email
    
    data = b"Hello!"
    SMIME_KEY = smime_email.load_key("key_path.pem")
    SMIME_INTERMEDIATE = smime_email.load_certificates("intermediate_path.pem")
    SMIME_CERT = smime_email.load_certificates("cert_path.pem")[0]
    email_raw_bytes = smime_email.get_smime_attachment_content(data, SMIME_KEY, SMIME_INTERMEDIATE, SMIME_CERT)
    
  2. Send it using any email library you like. Here is an example as Django email backend

    email_raw_bytes = smime_email.get_smime_attachment_content(data, SMIME_KEY, SMIME_INTERMEDIATE, SMIME_CERT)
    # ...
    class EmailBackend(BaseEmailBackend):
        def send_messages(self, message) -> int:
            with smtplib.SMTP(settings.EMAIL_HOST, settings.EMAIL_PORT) as server:
                server.sendmail(message.from_email, message.to, email_raw_bytes)
            return 1
    

Development

The code is formatted with ruff and checked with various linters. To run the whole linting and formatting process, run uv run poe all.

License

Code and documentation copyright 2024-2025 Siemens AG.

See LICENSE.md.

Release files for smime-email 1.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smime-email 1.0.7
File Size Uploaded
smime_email-1.0.7.tar.gz 2.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for smime-email 1.0.7
File Interpreter ABI Platform
smime_email-1.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 6.4 kB

Release files / smime_email-1.0.7.tar.gz

Download URL smime_email-1.0.7.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
47d3199f11daa2c813d63bdcc2d1f4439b7883ead13b897bae5cbae5f01ddfa1
BLAKE2b-256 checksum
How to use checksums
44727bada2e4a9dab5037b546e26af8f21dbde091a8661baf3f4f45bb043197f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.

Transparency log

Release files / smime_email-1.0.7-py3-none-any.whl

Download URL smime_email-1.0.7-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb389aa0540a3ccd9e0a1f354a4f40e3216ff8e0da2149919f04bce6f1e718b5
BLAKE2b-256 checksum
How to use checksums
846f2332436527b3827fd4bb261cb8f2f5319f2495c1d34302fe59ed2651b602
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.7 This release

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page