public static List<AthenzIdentity> findSiaServices(Path root) {
        String keyFileSuffix = ".key.pem";
        Path keysDirectory = root.resolve("keys");
        if ( ! Files.exists(keysDirectory))
            return List.of();

        try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(keysDirectory)) {
            return StreamSupport.stream(directoryStream.spliterator(), false)
                    .map(path -> path.getFileName().toString())
                    .filter(fileName -> fileName.endsWith(keyFileSuffix) && ! fileName.contains(":role."))
                    .map(fileName -> fileName.substring(0, fileName.length() - keyFileSuffix.length()))
                    .map(AthenzService::new)
                    .collect(toList());
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }
Misc utility methods for SIA provided credentials

@author bjorncs
vespa-athenz/src/main/java/com/yahoo/vespa/athenz/utils/SiaUtils.java