static Credential readCredential(final InputStream is) throws Exception {
        val certificateFactory = CertUtils.getCertificateFactory();
        val certificate = (X509Certificate) certificateFactory.generateCertificate(is);
        return new BasicX509Credential(certificate);
    }
Read credential.

@param is the stream
@return the credential
@throws Exception the exception
support/cas-server-support-wsfederation/src/main/java/org/apereo/cas/support/wsfederation/authentication/crypto/WsFederationCertificateProvider.java