private void writeBinaryCertificateToFile(final File file, final byte[] certificate) {
        if (file.exists()) {
            val res = file.delete();
            logger.debug("Deleted file [{}]:{}", file, res);
        }
        try (OutputStream fos = new FileOutputStream(file)) {
            fos.write(certificate);
            fos.flush();
        } catch (final Exception e) {
            logger.error(e.getMessage(), e);
        }
    }
<p>Constructor for SAML2FileSystemKeystoreGenerator.</p>

@param configuration a {@link SAML2Configuration} object
pac4j-saml/src/main/java/org/pac4j/saml/metadata/keystore/SAML2FileSystemKeystoreGenerator.java