class SecurityUtils {

    public static Set<String> loadCertificateChainBase64(HttpsConfig config) throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException {
        final Set<String> out = new HashSet<>();
        for (Certificate certificate : loadCertificateChain(config)) {
            final byte[] certificateEncoded = certificate.getPublicKey().getEncoded();
            final String base64 = Base64.getEncoder().encodeToString(certificateEncoded);
            out.add(base64);
        }
        return out;
    }

}