(&self)
| 13 | |
| 14 | impl Identity { |
| 15 | fn to_certificate(&self) -> Result<Certificate> { |
| 16 | let keystr = String::from_utf8_lossy(&self.key); |
| 17 | let key = KeyPair::from_pem(&keystr)?; |
| 18 | let certstr = String::from_utf8_lossy(&self.certificate); |
| 19 | let params = rcgen::CertificateParams::from_ca_cert_pem(&certstr, key)?; |
| 20 | let cert = Certificate::from_params(params)?; |
| 21 | Ok(cert) |
| 22 | } |
| 23 | |
| 24 | pub fn to_tonic_identity(&self) -> tonic::transport::Identity { |
| 25 | tonic::transport::Identity::from_pem(&self.certificate, &self.key) |
no outgoing calls
no test coverage detected