Trait rustls::crypto::SupportedKxGroup
source · pub trait SupportedKxGroup:
Send
+ Sync
+ Debug {
// Required methods
fn start(&self) -> Result<Box<dyn ActiveKeyExchange>, Error>;
fn name(&self) -> NamedGroup;
}
Expand description
A supported key exchange group.
This type carries both configuration and implementation. Specifically,
it has a TLS-level name expressed using the NamedGroup
enum, and
a function which produces a ActiveKeyExchange
.
Compare with NamedGroup
, which carries solely a protocol identifier.
Required Methods§
sourcefn start(&self) -> Result<Box<dyn ActiveKeyExchange>, Error>
fn start(&self) -> Result<Box<dyn ActiveKeyExchange>, Error>
Start a key exchange.
This will prepare an ephemeral secret key in the supported group, and a corresponding public key. The key exchange can be completed by calling ActiveKeyExchange or discarded.
§Errors
This can fail if the random source fails during ephemeral key generation.
sourcefn name(&self) -> NamedGroup
fn name(&self) -> NamedGroup
Named group the SupportedKxGroup operates in.
If the NamedGroup
enum does not have a name for the algorithm you are implementing,
you can use NamedGroup::Unknown
.