static String cleanCertificate(final String cert) {
        var result = StringUtils.remove(cert, BEGIN_CERTIFICATE);
        result = StringUtils.remove(result, END_CERTIFICATE).trim();
        return result;
    }
Clean certificate string.

@param cert the cert
@return the string
support/cas-server-support-saml-idp-core/src/main/java/org/apereo/cas/support/saml/idp/metadata/generator/SamlIdPMetadataGenerator.java