public static Optional<PrivateKey> readPrivateKeyFile(Path root, AthenzIdentity service) {
        try {
            Path privateKeyFile = getPrivateKeyFile(root, service);
            if (Files.notExists(privateKeyFile)) return Optional.empty();
            return Optional.of(KeyUtils.fromPemEncodedPrivateKey(new String(Files.readAllBytes(privateKeyFile))));
        } 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