Load a CA certificate and private key from files.
(cert_path: impl AsRef<Path>, key_path: impl AsRef<Path>)
| 67 | |
| 68 | /// Load a CA certificate and private key from files. |
| 69 | pub fn load(cert_path: impl AsRef<Path>, key_path: impl AsRef<Path>) -> Result<Self> { |
| 70 | let pem_key = fs::read_to_string(key_path).context("Failed to read key file")?; |
| 71 | let pem_cert = fs::read_to_string(cert_path).context("Failed to read cert file")?; |
| 72 | Self::new(pem_cert, pem_key) |
| 73 | } |
| 74 | |
| 75 | /// Sign a certificate request. |
| 76 | pub fn sign(&self, req: CertRequest<impl PublicKeyData>) -> Result<Certificate> { |
no outgoing calls
no test coverage detected