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

Uploaded CPython 3.14Windows x86-64

py_cert_store-0.3.2-cp314-cp314-win32.whl (148.6 kB view details)

Uploaded CPython 3.14Windows x86

py_cert_store-0.3.2-cp313-cp313-win_amd64.whl (154.3 kB view details)

Uploaded CPython 3.13Windows x86-64

py_cert_store-0.3.2-cp312-cp312-win_amd64.whl (154.4 kB view details)

Uploaded CPython 3.12Windows x86-64

py_cert_store-0.3.2-cp311-cp311-win_amd64.whl (156.3 kB view details)

Uploaded CPython 3.11Windows x86-64

py_cert_store-0.3.2-cp310-cp310-win_amd64.whl (156.2 kB view details)

Uploaded CPython 3.10Windows x86-64

File details

Details for the file py_cert_store-0.3.2-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for py_cert_store-0.3.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 7e49806bb7d32a27ef4a33405ac85b0af162a2aae5f24258792f73cbf3e2a166
MD5 125d7ea1778e073c3fb3b3afd891dd8c
BLAKE2b-256 653a7c085ffc79ebfd2d4f605b290bf5fef325e72c9a09f8f353a8b69692e822

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.3.2-cp314-cp314-win32.whl
Algorithm Hash digest
SHA256 84216e581cff715d9a2ae8cbfc310d5cb3581a0dbf5cab31f49f559c7404da03
MD5 c72ae30a92280357adc07615317aa6a3
BLAKE2b-256 871990d716addde1e8539df8339675c65bda7334c2c4da98fbc6daa46d16956f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.3.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 da81e9e80070980d2fc009514e352b36780273ecd6ec43e7f5f07325b07864e1
MD5 cf14af6e7b01f3dc0b3cd9539cb032a3
BLAKE2b-256 714e56e8601b5baa470249444e64c535479b4354ca59865423e6ad1d30dfd458

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.3.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 66e180cbdca604123eb5469c100b1cb901985dff3739d44c08cc940bc2baaf7e
MD5 c69d37e2fcfa10abf1b06a3f6984d686
BLAKE2b-256 dd4117039ae5c09513c607eb9553b19ad7a38b927ae1264f274fbb57397251ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.3.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4ba17b799ce49d7df3eed786483e4182baecd914d353f4ecd21f668f36479020
MD5 4298e254976e030dbe5d087afac80f2e
BLAKE2b-256 c7eddae518838329f69962b6ac507e2fb3aa53aa8b031ae35f7c742b8e640786

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.3.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 10479248ea674def07ef2393591bd8098231657807a17b8ab144772bbfcc2a19
MD5 765cd31125a7d74dbc6d0c36e728c4db
BLAKE2b-256 b3bd82e1e0cd47208d39ed991f07f29465eb76823c8c43499842a436879d99d0

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