Skip to main content

No project description provided

Project description

CI PyPI

Python Certificate Store

The Python Certificate Store (Py_Cert_Store) is a module designed with the intention of interacting with the windows certificate store.

The initial design of this module is to find a certificate meeting a set of basic criteria (Not expired, contains an extension, and is exportable).

Python Implementation

This code is designed to return a certificate that can be utilized when connecting with the python requests library.

from py_cert_store import get_win_cert
from requests import Session
from requests_pkcs12 import Pkcs12Adapter

certificate = get_win_cert()

with Session() as s:
    s.mount('https://example.com', Pkcs12Adapter(pkcs12_data=certificate))
    r = s.get('https://example.com/test')

For further selection of a certificate from the windows certificate store

from py_cert_store import find_windows_cert_by_extension
from cryptography import x509

valid_certificates = find_windows_cert_by_extension(
    store="My", user="CurrentUser",
    extension_oid=x509.OID_KEY_USAGE.dotted_string,
    extension_value="Digital Signature"
)

certificate_with_metadata = valid_certificates[0]

print(f"Using Certificate: {certificate_with_metadata['FriendlyName']}")
print(f"{certificate_with_metadata['Name']}")
print(f"Validity: {certificate_with_metadata['EffectiveDateString']} - {certificate_with_metadata['ExpirationDateString']}")

certificate = certificate_with_metadata["cert"]

...

Installing

This library is available as PyPI package:

pip install py_cert_store

Alternatively, you can retrieve the latest development version via Git: (Note: Rust must be installed to run the development branch)

git clone https://github.com/unwarymold9171/Py_Cert_Store.git

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

py_cert_store-0.3.0-cp314-cp314-win32.whl (142.8 kB view details)

Uploaded CPython 3.14Windows x86

py_cert_store-0.3.0-cp313-cp313-win_amd64.whl (149.6 kB view details)

Uploaded CPython 3.13Windows x86-64

py_cert_store-0.3.0-cp312-cp312-win_amd64.whl (149.4 kB view details)

Uploaded CPython 3.12Windows x86-64

py_cert_store-0.3.0-cp311-cp311-win_amd64.whl (149.3 kB view details)

Uploaded CPython 3.11Windows x86-64

py_cert_store-0.3.0-cp310-cp310-win_amd64.whl (149.4 kB view details)

Uploaded CPython 3.10Windows x86-64

py_cert_store-0.3.0-cp39-cp39-win_amd64.whl (149.6 kB view details)

Uploaded CPython 3.9Windows x86-64

File details

Details for the file py_cert_store-0.3.0-cp314-cp314-win32.whl.

File metadata

File hashes

Hashes for py_cert_store-0.3.0-cp314-cp314-win32.whl
Algorithm Hash digest
SHA256 34f3ef7d0f15177b07a3405b513e35f42e1f05df9a64322653cde52591635e7b
MD5 5763783305e2072b4936eb324ffca891
BLAKE2b-256 a6b508b14b86341eb207546591df07af0ed3d5415c1eda3b49722d7099e98ed9

See more details on using hashes here.

File details

Details for the file py_cert_store-0.3.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for py_cert_store-0.3.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ae3c57a6977c39fdda8a385e1b04046ccb4a6cebdc180cb9878101d8170d0f1d
MD5 cf34f1da7310a6c5b451b41b987d70a1
BLAKE2b-256 3d1dab6411fdce0e4b16abb18dade7b5fb983a923d7718439e24ae8de63e3552

See more details on using hashes here.

File details

Details for the file py_cert_store-0.3.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for py_cert_store-0.3.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 07e2827c604bfa6f35ea7274ad4c75600c1ffd18e95808082a3b96d431688a3d
MD5 8255008edb2563abe37f23aa6a68cb1e
BLAKE2b-256 a1a59a020d7845565326174b1d0843efdc6e7c92e815e18a930bdbbf5bc052ab

See more details on using hashes here.

File details

Details for the file py_cert_store-0.3.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for py_cert_store-0.3.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7bd25306adb4ed18f670c81a3be3954d21e949c299a726162d68def187f138b2
MD5 2dceed3f74961b254b57c5b7f6c50751
BLAKE2b-256 2244cf337cb44c2b7feeb82f5a52964510c7c87abd025a5e9051fb3c1d9014fd

See more details on using hashes here.

File details

Details for the file py_cert_store-0.3.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for py_cert_store-0.3.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 bb203b7ffa6a2d6c6e5b548f207459789ec94dc8c7d67731da6ddd5caed7b330
MD5 4529623ad8b640b5c0148ebe5291fe04
BLAKE2b-256 e807aac250679839c327b0fe81f8d1210e83a158e7d7b3f16e1cba68193cf0f5

See more details on using hashes here.

File details

Details for the file py_cert_store-0.3.0-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for py_cert_store-0.3.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c103f48280b21d3f417f35eb51fff17c93297c2a272af43aedcfb227abc8534d
MD5 45e5399751aca3a11217e26dc87d9076
BLAKE2b-256 d7b635e24c85fd1e659e4774b75e26c2613b923adddd430bbe682231f63aa98a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page