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.2.1-cp313-cp313-win_amd64.whl (150.4 kB view details)

Uploaded CPython 3.13Windows x86-64

py_cert_store-0.2.1-cp313-cp313-win32.whl (143.9 kB view details)

Uploaded CPython 3.13Windows x86

py_cert_store-0.2.1-cp312-cp312-win_amd64.whl (150.6 kB view details)

Uploaded CPython 3.12Windows x86-64

py_cert_store-0.2.1-cp312-cp312-win32.whl (144.0 kB view details)

Uploaded CPython 3.12Windows x86

py_cert_store-0.2.1-cp311-cp311-win_amd64.whl (150.6 kB view details)

Uploaded CPython 3.11Windows x86-64

py_cert_store-0.2.1-cp311-cp311-win32.whl (144.1 kB view details)

Uploaded CPython 3.11Windows x86

py_cert_store-0.2.1-cp310-cp310-win_amd64.whl (150.7 kB view details)

Uploaded CPython 3.10Windows x86-64

py_cert_store-0.2.1-cp310-cp310-win32.whl (144.2 kB view details)

Uploaded CPython 3.10Windows x86

py_cert_store-0.2.1-cp39-cp39-win_amd64.whl (151.1 kB view details)

Uploaded CPython 3.9Windows x86-64

py_cert_store-0.2.1-cp39-cp39-win32.whl (144.4 kB view details)

Uploaded CPython 3.9Windows x86

py_cert_store-0.2.1-cp38-cp38-win_amd64.whl (150.9 kB view details)

Uploaded CPython 3.8Windows x86-64

py_cert_store-0.2.1-cp38-cp38-win32.whl (144.1 kB view details)

Uploaded CPython 3.8Windows x86

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.2.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a1d5d99a217c7e9a3e2b4269ad25e849d9abd10a0f1a3f4e0d7fd0ee162309fb
MD5 e4eaef249e55445a7bb711875104c559
BLAKE2b-256 c5f3bc8f3db207cbb139f413cace619c42cdb8d939bc3c76b764ba2af779c397

See more details on using hashes here.

File details

Details for the file py_cert_store-0.2.1-cp313-cp313-win32.whl.

File metadata

File hashes

Hashes for py_cert_store-0.2.1-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 39557c4e385e363dab1c032667daf0966e2d8dd4daa5a8cf88857c205efeb857
MD5 8475c94ac52627445250b43d6400c11c
BLAKE2b-256 e6794f327999ee82bd198e71aab41ca875d88d8f8f8c6d69632d01446490892c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.2.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 56a770078366acb024c73f57469fff19ff22b64bb648443f5d8af648e66c314f
MD5 08ddef58486bd64359e34d1e6188d0f3
BLAKE2b-256 2869d89b2ab3e225f2fe393b1d889c4a77ce25dc80079a7b285167b5abe5c46b

See more details on using hashes here.

File details

Details for the file py_cert_store-0.2.1-cp312-cp312-win32.whl.

File metadata

File hashes

Hashes for py_cert_store-0.2.1-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 54147e3b198293fcf203abbbfbfdc9ba6a13e9a31adb5bcd6c798deb25fdb114
MD5 98c61a3dc21c77f303764f1fe509a6f9
BLAKE2b-256 9d34c89514dec5d9dd4244e6a94b422703e7640b3c266b1c55ca32f8a12b6c92

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.2.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 df7616e80a2d2f2554ee209439328aa8b95b776f48812fb030aef42b18b89687
MD5 81593a3b5f94093eb769377838a88051
BLAKE2b-256 983e830976fec85c816602f95e5929555dec5ee8222db8b4398076db5c6fbd6e

See more details on using hashes here.

File details

Details for the file py_cert_store-0.2.1-cp311-cp311-win32.whl.

File metadata

File hashes

Hashes for py_cert_store-0.2.1-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 a01b965d1ad76dd32f50f0c5588ed25c95f5b335ecf9efe54e7bb6347a4cc1b1
MD5 2aab43414f5183cbf0ed10ed05602af6
BLAKE2b-256 2ca574d9e7c074dedfa9945179b88e025f9c25f102fd95c9e250adddbf874250

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.2.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e1508ff544ae9778a740000fdebf172723ce6773bad3fdc47fb57bf7f909acad
MD5 58cb72610041f531f065af59b66094f9
BLAKE2b-256 5500ad53017876a56fbc71e8e62adecaae2e5c4a9868eb8aa4c892c7f8f9cd2a

See more details on using hashes here.

File details

Details for the file py_cert_store-0.2.1-cp310-cp310-win32.whl.

File metadata

File hashes

Hashes for py_cert_store-0.2.1-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 58e90c1cdaa0afbb5479626a96f04515f52231b6dc6b57d846091aeffdbe2f8c
MD5 6175c180b455a240fd194419fd5a2dc2
BLAKE2b-256 fedd7d0de7a799921015b3855662a590f472b04c6870e7a351083169527461e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.2.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 64cce9d1c6c956be7338b1de2829ba74e1179ad3f7e4f968846a8d5b6b6a15ca
MD5 5da499bb9e87d19917151e3790a3347f
BLAKE2b-256 310ec70532fa1e83be4b63ea15884452e86ef30b2e2d59bf1fc0cd12991dd5b3

See more details on using hashes here.

File details

Details for the file py_cert_store-0.2.1-cp39-cp39-win32.whl.

File metadata

File hashes

Hashes for py_cert_store-0.2.1-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 b5089164b7747e248fd521dcd42be741918ab27a436d4863f718237df7f29353
MD5 ea06401484547ca770f03b91e1d0ab88
BLAKE2b-256 0f5ba771a440c92c8dd7d376e76fc4c953aa7d9d418f4de3eaf3fa1ecc00287c

See more details on using hashes here.

File details

Details for the file py_cert_store-0.2.1-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for py_cert_store-0.2.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 1260255adf36958341fa108d47dd3fa1b8c565960712740a8e5a2e9593e1667e
MD5 e10084668f9acc5077c2675fc0d00d10
BLAKE2b-256 4fd77619fe7f212f310c9006bf21f0a4a24a31480c125cc821bf66fddcb6f01c

See more details on using hashes here.

File details

Details for the file py_cert_store-0.2.1-cp38-cp38-win32.whl.

File metadata

File hashes

Hashes for py_cert_store-0.2.1-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 f1a8ef2c143ae59616c2d77057d3223138e51573afa68447854b52702aeb775b
MD5 78e96cbb26cb2569a1b05df4908403f3
BLAKE2b-256 96f652d6789eeea3f2e59902a917e06c0287e74a3864123f20db66fb14b237bc

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