Crates.io | rustls-cng |
lib.rs | rustls-cng |
version | 0.5.1 |
source | src |
created_at | 2022-06-13 14:38:27.251188 |
updated_at | 2024-10-13 11:27:02.719555 |
description | Windows CNG API bridge for rustls |
homepage | |
repository | https://github.com/rustls/rustls-cng |
max_upload_size | |
id | 605148 |
size | 73,847 |
This crate allows you to use the Windows CNG private keys together with rustls for both the client and server sides of the TLS channel.
Rationale: In many situations, it is required to use non-exportable private certificate chains
from the Windows certificate store instead of the external PKCS8 file.
rustls-cng
can use such chains in the rustls
context.
Supported key/certificate types: RSA, ECDSA/ECDH. Supported elliptic curves: secp256r1 (prime256v1), secp384r1.
Documentation is available here.
The central struct to use in rustls-cng
is CngSigningKey
, which can be constructed
from the low-level NCryptKey
handle. The instance of CngSigningKey
can then be
used in rustls
in the custom ResolvesServerCert
or ResolvesClientCert
implementation.
See the examples
directory for usage examples.
Licensed under the MIT or Apache licenses (LICENSE-MIT or LICENSE-APACHE)