# uselesskey-rustls
[](https://crates.io/crates/uselesskey-rustls)
[](https://docs.rs/uselesskey-rustls)
[](#license)
[`rustls`](https://crates.io/crates/rustls) /
[`rustls-pki-types`](https://crates.io/crates/rustls-pki-types) adapter for
[`uselesskey`](https://crates.io/crates/uselesskey) test fixtures.
Converts fixture certs and keys into `CertificateDer` / `PrivateKeyDer`, with
optional `ServerConfig` / `ClientConfig` builders (including mTLS support).
## Features
| `x509` (default) | X.509 cert and chain conversions |
| `rsa` | RSA keypairs → `PrivateKeyDer` |
| `ecdsa` | ECDSA keypairs → `PrivateKeyDer` |
| `ed25519` | Ed25519 keypairs → `PrivateKeyDer` |
| `all` | All key conversion traits |
| `server-config` | `rustls::ServerConfig` builders |
| `client-config` | `rustls::ClientConfig` builders |
| `tls-config` | Both server and client config builders |
| `rustls-ring` | ring crypto provider integration |
| `rustls-aws-lc-rs` | aws-lc-rs crypto provider integration |
## Usage
```toml
[dev-dependencies]
uselesskey-rustls = { version = "0.5.1", features = ["tls-config", "rustls-ring"] }
```
```rust
use uselesskey_core::Factory;
use uselesskey_rustls::{RustlsClientConfigExt, RustlsServerConfigExt};
use uselesskey_x509::{ChainSpec, X509FactoryExt};
let fx = Factory::random();
let chain = fx.x509_chain("svc", ChainSpec::new("test.example.com"));
let server = chain.server_config_rustls();
let client = chain.client_config_rustls();
let _ = (server, client);
```
## License
Licensed under either of [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
or [MIT license](https://opensource.org/licenses/MIT) at your option.
See the [`uselesskey` crate](https://crates.io/crates/uselesskey) for full
documentation.