public static PublicKey extractPublicKeyFromResource(final String secretKeyToUse) {
        return FunctionUtils.doUnchecked(() -> {
            LOGGER.debug("Attempting to extract public key from [{}]...", secretKeyToUse);
            val resource = ResourceUtils.getResourceFrom(secretKeyToUse);
            val factory = new PublicKeyFactoryBean(resource, RsaKeyUtil.RSA);
            factory.setSingleton(false);
            return factory.getObject();
        });
    }
Extract public key from resource public key.

@param secretKeyToUse the secret key to use
@return the public key
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/cipher/AbstractCipherExecutor.java