public static X509Certificate readCertificate(final InputStream resource) {
        return readCertificate(new InputStreamResource(resource));
    }
Read certificate x 509 certificate.

@param resource the resource
@return the x 509 certificate
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/crypto/CertUtils.java