@startuml skinparam dpi 150 start : add start edge to queue; repeat if (queue has next edge?) then (yes) : take next edge from queue; else (no) :return empty path; stop; endif if (is end edge?) then (yes) : build path from parent map; if (path validates?) then (yes) :return validated path; stop; else (no) endif else (no) endif if (edge visited?) then (yes) else (no) : mark edge visited; switch (edge type?) case ( certificate edge ) : search certificate issuers in store; if (has issuers?) then (yes) :add issuers to queue; :map issuers edges to parent edge; if (certificate has aia?) then (yes) :add aia url edges to queue; :map url edges to parent edge; else (no) endif else (no) if (certificate has aia?) then (yes) :add aia url edges to queue; :map url edges to parent edge; else (no) : add end edge to queue; endif endif case ( url edge ) : download certificates with url; :map new certificate edges to parent edge; if (certificates are issuer?) then (yes) :add issuers to queue; else (no) : add end edge to queue; endif case ( end edge ) endswitch endif repeat while @enduml