protected PublicKey getPublicKey() {
        if (null == getPublicKeyInfo()) {
            return null;
        }
        try (val is = getPublicKeyInfo().getInputStream()) {
            return KeyPairUtil.readPublicKey(is);
        } catch (final Exception e) {
            throw new FatalBeanException("Could not decode public key", e);
        }
    }
Gets public key.

@return the public key
support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/credential/BasicResourceCredentialFactoryBean.java