(workdir: impl AsRef<Path>)
| 249 | } |
| 250 | |
| 251 | pub fn list_certs(workdir: impl AsRef<Path>) -> Result<Vec<PathBuf>> { |
| 252 | let mut certs = vec![]; |
| 253 | let cert_dir = Path::new(workdir.as_ref()); |
| 254 | for entry in fs::read_dir(cert_dir)? { |
| 255 | let entry = entry?; |
| 256 | let path = entry.path(); |
| 257 | let cert_path = path.join("cert.pem"); |
| 258 | if path.is_dir() && cert_path.exists() { |
| 259 | certs.push(cert_path); |
| 260 | } |
| 261 | } |
| 262 | Ok(certs) |
| 263 | } |
| 264 | |
| 265 | pub fn list_cert_public_keys(workdir: impl AsRef<Path>) -> Result<BTreeSet<Vec<u8>>> { |
| 266 | list_certs(workdir)? |
no test coverage detected