@Nonnull
    @Override
    protected PublicKey createInstance() throws Exception {
        var key = readPemPublicKey();
        if (key == null) {
            LOGGER.debug("Key [{}] is not in PEM format. Trying next...", this.resource);
            key = readDERPublicKey();
        }
        return key;
    }
Initialize cipher based on service public key.

@return the false if no public key is found
or if cipher cannot be initialized, etc.
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/crypto/PublicKeyFactoryBean.java