class SimpleAsymmetricConfig {

    private String privateKey = null;
    private String publicKey = null;
    private String privateKeyLocation = null;
    private String publicKeyLocation = null;
    private Resource privateKeyResource = null;
    private Resource publicKeyResource = null;
    private ResourceLoader resourceLoader = new DefaultResourceLoader();
    private KeyFormat privateKeyFormat = KeyFormat.DER;
    private KeyFormat publicKeyFormat = KeyFormat.DER;

    private Resource loadResource(Resource asResource, String asString, String asLocation, KeyFormat format, String type) {<FILL_FUNCTION_BODY>}

    /**
     * <p>loadPrivateKeyResource.</p>
     *
     * @return a {@link org.springframework.core.io.Resource} object
     */
    public Resource loadPrivateKeyResource() {
        return loadResource(privateKeyResource, privateKey, privateKeyLocation, privateKeyFormat, "Private");
    }

    /**
     * <p>loadPublicKeyResource.</p>
     *
     * @return a {@link org.springframework.core.io.Resource} object
     */
    public Resource loadPublicKeyResource() {
        return loadResource(publicKeyResource, publicKey, publicKeyLocation, publicKeyFormat, "Public");
    }

    /**
     * <p>setKeyFormat.</p>
     *
     * @param keyFormat a {@link com.ulisesbocchio.jasyptspringboot.util.AsymmetricCryptography.KeyFormat} object
     */
    public void setKeyFormat(KeyFormat keyFormat) {
        setPublicKeyFormat(keyFormat);
        setPrivateKeyFormat(keyFormat);
    }

}

        return Optional.ofNullable(asResource)
                .orElseGet(() ->
                        Optional.ofNullable(asString)
                                .map(pk -> (Resource) new ByteArrayResource(format == KeyFormat.DER ? Base64.getDecoder().decode(pk) : pk.getBytes(StandardCharsets.UTF_8)))
                                .orElseGet(() ->
                                        Optional.ofNullable(asLocation)
                                                .map(resourceLoader::getResource)
                                                .orElseThrow(() -> new IllegalArgumentException("Unable to load " + type + " key. Either resource, key as string, or resource location must be provided"))));
    
<no_super_class>