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

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

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

import no.difi.certvalidator.api.CertificateBucket;
import no.difi.certvalidator.api.CertificateBucketException;

import javax.security.auth.x500.X500Principal;
import java.security.cert.X509Certificate;
import java.util.Iterator;

/**
 * Wrapper for certificate bucket. May be used to switch or update certificate buckets on-fly.
 */
public class CertificateBucketWrapper implements CertificateBucket {

    private CertificateBucket certificateBucket;

    public CertificateBucketWrapper(CertificateBucket certificateBucket) {
        this.certificateBucket = certificateBucket;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public X509Certificate findBySubject(X500Principal principal) throws CertificateBucketException {
        return certificateBucket.findBySubject(principal);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Iterator iterator() {
        return certificateBucket.iterator();
    }

    public CertificateBucket getCertificateBucket() {
        return certificateBucket;
    }

    public void setCertificateBucket(CertificateBucket certificateBucket) {
        this.certificateBucket = certificateBucket;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy