@Override
    public Pair<String, String> buildSelfSignedEncryptionCert(final Optional<SamlRegisteredService> registeredService) throws Throwable {
        val encCert = getConfigurationContext().getSamlIdPMetadataLocator().resolveEncryptionCertificate(registeredService);
        val encKey = getConfigurationContext().getSamlIdPMetadataLocator().resolveEncryptionKey(registeredService);
        if (encCert.isFile() && encKey.isFile()) {
            writeCertificateAndKey(encCert.getFile(), encKey.getFile(), registeredService);
        }
        return Pair.of(encCert.getContentAsString(StandardCharsets.UTF_8), encKey.getContentAsString(StandardCharsets.UTF_8));
    }
A metadata generator based on a predefined template.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-saml-idp-core/src/main/java/org/apereo/cas/support/saml/idp/metadata/generator/FileSystemSamlIdPMetadataGenerator.java