All Downloads are FREE. Search and download functionalities are using the official Maven repository.

no.difi.certvalidator.util.SimpleCrlCache Maven / Gradle / Ivy

There is a newer version: 2.2.1
Show newest version
package no.difi.certvalidator.util;

import no.difi.certvalidator.api.CrlCache;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.security.cert.X509CRL;
import java.util.Map;
import java.util.TreeMap;

/**
 * In-memory implementation of CRL cache. Used as default implementation.
 */
public class SimpleCrlCache implements CrlCache {

    private Map storage = new TreeMap();

    @Override
    public X509CRL get(String url) {
        return storage.get(url);
    }

    @Override
    public void set(String url, X509CRL crl) {
        if (crl == null)
            storage.remove(url);
        else
            storage.put(url, crl);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy