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

Uploaded CPython 3.14Windows x86-64

py_cert_store-0.3.1-cp314-cp314-win32.whl (144.3 kB view details)

Uploaded CPython 3.14Windows x86

py_cert_store-0.3.1-cp313-cp313-win_amd64.whl (150.7 kB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.10Windows x86-64

py_cert_store-0.3.1-cp39-cp39-win_amd64.whl (150.9 kB view details)

Uploaded CPython 3.9Windows x86-64

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.3.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 c4fe88df63f92c1fce2684217302cb7fb5422a0db700f3337fc321fbfc99cb96
MD5 40d7d5fca31c2e56aed6b99fa314048d
BLAKE2b-256 ad555e93f798e255621463afda36b5a2716882bf9f65519fb793b002cfd593aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.3.1-cp314-cp314-win32.whl
Algorithm Hash digest
SHA256 bc505e12070720edb7678583eb7727129cab2b4fafdbccace6885bb1a9d1565a
MD5 48f7a7a743e0f1671e288d1f3db77c03
BLAKE2b-256 58475c4a457a28b9a46ccf2d3368601ad7a075f5ea7eea7c5bdc3d607c4b318c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.3.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 bb909f15c079f889cf30fc393265357b859d1cf9ab3d12edb99e49204c8fdcfb
MD5 d1b35ccd94b30a7123bca054fa5a2de7
BLAKE2b-256 0ac2ebbf5dfce1144c1fe35fd63ccee30ca8fa14cbf67f36e601167d02976c6a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.3.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c4161b4313dbe1023f4a0c6ee0c9f9e54d54f74f73dbcb7655a259ed03467fd5
MD5 9722b8bd87e046ca55375ea411757634
BLAKE2b-256 05871848d3390aa0390e01eadd5ef26b5bdafe80d7ddfbd3cfe043de43c6125c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.3.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a13ff2fdf5a10e8141e691fe35335d1a6a86dbd1f41fe5d39b948532053672cf
MD5 70a4cc97eff49a75c5577660e0c3516e
BLAKE2b-256 ef7f0812a839863f18dca4d4f625ed430cb9a0a0529ac72255e5a2b024cfd483

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.3.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a40134a91e7b9a5434c14fbf1594dc89f7aedd74302f16bb52d1dd7a63d7863b
MD5 f6d4d8e8171621cbaa2a84f2b369c867
BLAKE2b-256 ba528b05037d18b47d31305f935a0c11570335d4cb30a080f9b0520b5e238368

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_cert_store-0.3.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b93cd9397d0bdf31649df3b6bbea61c75004d8c7731b6e76e02499c5139ced1f
MD5 c16f29ed2988eb74ee4934e58f6ec9d8
BLAKE2b-256 9521d449199a3b1102923d911c76dc457deb9684117eba84c7f5e3deaa189600

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