sfackler / rust-native-tls

Apache License 2.0
470 stars 195 forks source link

`Identity` should be a factory #232

Open obsgolem opened 2 years ago

obsgolem commented 2 years ago

Currently, Identity is given a PKCS#12 or PKCS#8 blob. This does not encompass several usecases, including smartcards, whose private key is non-exportable. In order to fix this, Identity should be changed to be a factory that returns an imp::Identity.

Basic factories on Windows would be

I expect MacOS has a similar system for prompting the user to choose a cert. I don't know if Linux does, but factories should still be applicable there.

The one usecase this wouldn't support is choosing an identity based on what identities the server says it will accept, but that extension should be doable.

sfackler commented 2 years ago

If you can design a cross-platform interface for that kind of identity it seems doable to add.