sfackler / rust-native-tls

Apache License 2.0
468 stars 197 forks source link

Use schannel CertContext to create an Identity #288

Closed jnugh closed 6 months ago

jnugh commented 6 months ago

I'm trying to use a schannel::cert_context::CertContext that has been obtained from a schannel::cert_store::CertStore without exporting the private key to use one of the Identity constructors.

e.g.:

let store = CertStore::open_current_user("My").unwrap();
let cert = store.certs().next().unwrap();

The CertContext can be used for TLS client authentication without ever reading the private key from the Windows certificate store. This would very likely be platform dependent so I was wondering if this would be in scope for this project and if so if you'd be open for a PR.

sfackler commented 6 months ago

The underlying TLS libraries are not publicly exposed.

jnugh commented 6 months ago

So as I thought this would be out of scope. Thanks for your reply. I'll close this issue then.