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

Uploaded CPython 3.13Windows x86-64

py_cert_store-0.2.2-cp313-cp313-win32.whl (145.0 kB view details)

Uploaded CPython 3.13Windows x86

py_cert_store-0.2.2-cp312-cp312-win_amd64.whl (151.3 kB view details)

Uploaded CPython 3.12Windows x86-64

py_cert_store-0.2.2-cp312-cp312-win32.whl (144.9 kB view details)

Uploaded CPython 3.12Windows x86

py_cert_store-0.2.2-cp311-cp311-win_amd64.whl (151.4 kB view details)

Uploaded CPython 3.11Windows x86-64

py_cert_store-0.2.2-cp311-cp311-win32.whl (145.1 kB view details)

Uploaded CPython 3.11Windows x86

py_cert_store-0.2.2-cp310-cp310-win_amd64.whl (151.5 kB view details)

Uploaded CPython 3.10Windows x86-64

py_cert_store-0.2.2-cp310-cp310-win32.whl (145.3 kB view details)

Uploaded CPython 3.10Windows x86

py_cert_store-0.2.2-cp39-cp39-win_amd64.whl (151.8 kB view details)

Uploaded CPython 3.9Windows x86-64

py_cert_store-0.2.2-cp39-cp39-win32.whl (145.4 kB view details)

Uploaded CPython 3.9Windows x86

py_cert_store-0.2.2-cp38-cp38-win_amd64.whl (151.6 kB view details)

Uploaded CPython 3.8Windows x86-64

py_cert_store-0.2.2-cp38-cp38-win32.whl (145.1 kB view details)

Uploaded CPython 3.8Windows x86

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.2.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b720ec542f9298664b2468b250b349427bf37b3b36ea762496da5a821a2630b3
MD5 481db1a8abd24b0a9c203409b891e0c1
BLAKE2b-256 69566f18d1fbb0fe1e7d7c7672c2d6b552b4215d0b5b5937015b949d0a756e60

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.2.2-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 673cef7490f9f4ad4d2c673dc71153aab9ad0afdee0c5d7e62a03f19e7100464
MD5 e51bd7c43dc207bdda1d626b5fee3771
BLAKE2b-256 6b1941db330d9f4eac40e7827d145af4332b1074f49b0d12cdc7ea3ecacdce6d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.2.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7d887a6600aebf4c3d282e256f1e5d1ac430cfe08d9e90c78eece1b41ad4ccba
MD5 e3826b4c655ed3bed955ec433a1be96c
BLAKE2b-256 55e88a66bf76cef91f235eb1660b6d75d9209550508719292d15c1ac9e48c2b0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.2.2-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 8f8fe07eb3d25bd5ac4e7f64d01ca9d2b5974676357d6c29caa3194f500257ef
MD5 5c3783ebcb2e2225d9fc4bb7dfc5f789
BLAKE2b-256 1091015a1c7d2c826d21a48c74f5b5ab3ccf1154080e97b7014a54c1e79a5d48

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.2.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 abd8411d5ffa99ae8d8940ea91cd1b062c4ed23e28288be19a926c98f9c2f012
MD5 026ca736910e7e4db9a16c6ceba783eb
BLAKE2b-256 da4a974503c3c2f6c2ada524535e22e30c09aac89d65706dc3469a50003c83f7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.2.2-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 26f2d03cad9f61050fba9ac7b480fadb63c286842dd031a66b5705d7ecd7c9f9
MD5 e9c1c6d952b71b0fbd41905445a4d8b5
BLAKE2b-256 df2f1af65bc1efc9fea9e944a221ed18abd6780645703dcf739b5f971096f967

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.2.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 50d62fbf104a7e96263d0675203acbce7113abc336434e479cee054e6f0dbd6a
MD5 f6c77d1f48d3f8b3a70cb67601cb5e9e
BLAKE2b-256 514b7b6e6ebd27dab54529c2ebb5ab70a5a6eaa22c2cfabf35297a8a4dfd40d3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.2.2-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 69d9807fb3c17946703e667ac13bf19a8a33f419b2baae2248abbbf4e27cedc6
MD5 a2feef0dd111f37503c252cf7660e651
BLAKE2b-256 a1e0541a695a820a33da7d42db81408f50e653f40228682e357ddacb91219771

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.2.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e8836815bcc843769b1e0f733f5d1646e1c0c234c868112211db43cb7c4212dc
MD5 7e603f0afae60bd7df2f0d9c35082f09
BLAKE2b-256 a3ca0f6ee208b9f6375c1d03a3e068f504a8070ffce83cef7b63a53722076e7d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.2.2-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 508618e2e9a399f6edc574194cbe52623dc841ac3abed82c2fbdee1fb013ee17
MD5 767090b4eb04c3fdc2afa1699c5fd7c3
BLAKE2b-256 82290941125befd7554221caedb5c4c5bbc6edaaa120c4061ccaac7f44131caf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.2.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 5f0775f28b9ebe33ebd9ba6e7ec3573287822311f8ea2af6b806b3e327b16317
MD5 0c6b8641f3774a47b2852787be894988
BLAKE2b-256 c4436321a9b707ec0dd78dcdaec521cf757e6709c1a8be746296bc60ae5c3870

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.2.2-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 7af96f66d7f72356660bf9e44b66a0689e707895fa3e434287dc6fb5dc7d919d
MD5 76387622296c306e3281c390d0cb2a09
BLAKE2b-256 a57975e258112706cd1c38f30cdcbd75446a34bf779a1610b1f817f301e944fa

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