A Python interface to cryptographic data in the Windows Certificate Store.
Not yet packaged.
Here is how you can create an SSL/TLS context using a certificate (with private key) contained in the Windows Certificate Store.
import wincerts
my_store = wincerts.CertStore('My')
for pkcs12 in my_store.iter_pkcs12():
if not pkcs12.cert_expired and pkcs12.has_private_key and 'digitalSignature' in pkcs12.cert_keyusages:
print('Valid certificate found')
break
ssl_ctx = pkcs12.create_ssl_context()
The references to the source docs for getting this together.