Parse the certificate lazily
(&self)
| 5087 | impl PySSLCertificate { |
| 5088 | // Parse the certificate lazily |
| 5089 | fn parse(&self) -> Result<x509_parser::certificate::X509Certificate<'_>, String> { |
| 5090 | match x509_parser::parse_x509_certificate(&self.der_bytes) { |
| 5091 | Ok((_, cert)) => Ok(cert), |
| 5092 | Err(e) => Err(format!("Failed to parse certificate: {e}")), |
| 5093 | } |
| 5094 | } |
| 5095 | } |
| 5096 | |
| 5097 | #[pyclass(with(Comparable, Hashable, Representable))] |