Skip to main content

rtc_dtls/
client_certificate_type.rs

1#[derive(Copy, Clone, Debug, PartialEq, Eq)]
2/// The certificate types a server may request from a client.
3pub enum ClientCertificateType {
4    /// `RSA_SIGN` (`1`).
5    RsaSign = 1,
6    /// `ECDSA_SIGN` (`64`).
7    EcdsaSign = 64,
8    /// A type this crate does not implement.
9    Unsupported,
10}
11
12impl From<u8> for ClientCertificateType {
13    fn from(val: u8) -> Self {
14        match val {
15            1 => ClientCertificateType::RsaSign,
16            64 => ClientCertificateType::EcdsaSign,
17            _ => ClientCertificateType::Unsupported,
18        }
19    }
20}