MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / list_certs

Function list_certs

certbot/src/bot.rs:251–263  ·  view source on GitHub ↗
(workdir: impl AsRef<Path>)

Source from the content-addressed store, hash-verified

249}
250
251pub 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
265pub fn list_cert_public_keys(workdir: impl AsRef<Path>) -> Result<BTreeSet<Vec<u8>>> {
266 list_certs(workdir)?

Callers 3

list_certsMethod · 0.85
list_cert_public_keysFunction · 0.85
list_certsMethod · 0.85

Calls 2

pathMethod · 0.80
as_refMethod · 0.45

Tested by

no test coverage detected