eu.emi.security.authn.x509.helpers.trust
Class DirectoryTrustAnchorStore

java.lang.Object
  extended by eu.emi.security.authn.x509.helpers.trust.TrustAnchorStoreBase
      extended by eu.emi.security.authn.x509.helpers.trust.DirectoryTrustAnchorStore
All Implemented Interfaces:
TrustAnchorStore
Direct Known Subclasses:
OpensslTrustAnchorStore

public class DirectoryTrustAnchorStore
extends TrustAnchorStoreBase

Retrieves CA certificates from locations given as local paths with wildcards or URLs.

Author:
K. Benedyczak

Field Summary
protected  Set<TrustAnchorExt> anchors
           
protected  CertificateUtils.Encoding encoding
           
protected  Map<URL,TrustAnchorExt> locations2anchors
           
 
Fields inherited from class eu.emi.security.authn.x509.helpers.trust.TrustAnchorStoreBase
observers
 
Constructor Summary
  DirectoryTrustAnchorStore(List<String> locations, String diskCache, int connectionTimeout, Timer t, long updateInterval, CertificateUtils.Encoding encoding, ObserversHandler listeners)
           
protected DirectoryTrustAnchorStore(List<String> locations, String diskCache, int connectionTimeout, Timer t, long updateInterval, CertificateUtils.Encoding encoding, ObserversHandler observers, boolean noFirstUpdate)
           
 
Method Summary
 String getCacheDir()
           
 int getConnTimeout()
           
 CertificateUtils.Encoding getEncoding()
           
 List<String> getLocations()
           
 Set<TrustAnchor> getTrustAnchors()
           
 X509Certificate[] getTrustedCertificates()
           
protected  X509Certificate loadCert(URL url)
           
protected  void reloadCerts(Collection<URL> locations)
          For all URLs tries to load a CA cert.
protected  void update()
          1.
 
Methods inherited from class eu.emi.security.authn.x509.helpers.trust.TrustAnchorStoreBase
checkValidity, dispose, getUpdateInterval, scheduleUpdate, setUpdateInterval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

anchors

protected Set<TrustAnchorExt> anchors

locations2anchors

protected Map<URL,TrustAnchorExt> locations2anchors

encoding

protected CertificateUtils.Encoding encoding
Constructor Detail

DirectoryTrustAnchorStore

public DirectoryTrustAnchorStore(List<String> locations,
                                 String diskCache,
                                 int connectionTimeout,
                                 Timer t,
                                 long updateInterval,
                                 CertificateUtils.Encoding encoding,
                                 ObserversHandler listeners)

DirectoryTrustAnchorStore

protected DirectoryTrustAnchorStore(List<String> locations,
                                    String diskCache,
                                    int connectionTimeout,
                                    Timer t,
                                    long updateInterval,
                                    CertificateUtils.Encoding encoding,
                                    ObserversHandler observers,
                                    boolean noFirstUpdate)
Method Detail

loadCert

protected X509Certificate loadCert(URL url)
                            throws IOException,
                                   URISyntaxException,
                                   CertificateEncodingException
Throws:
IOException
URISyntaxException
CertificateEncodingException

reloadCerts

protected void reloadCerts(Collection<URL> locations)
For all URLs tries to load a CA cert. Information for extensions: this method is guaranteed to be called once per update.


update

protected void update()
1. work only if schedulingNeeded() 2. for all wildcards refresh file lists 3. remove the locations not valid anymore 4. for all location URLs try to get the cert 5. update timestamp 6. schedule the next update if enabled

Specified by:
update in class TrustAnchorStoreBase

getTrustAnchors

public Set<TrustAnchor> getTrustAnchors()

getTrustedCertificates

public X509Certificate[] getTrustedCertificates()

getLocations

public List<String> getLocations()

getConnTimeout

public int getConnTimeout()

getCacheDir

public String getCacheDir()

getEncoding

public CertificateUtils.Encoding getEncoding()


Copyright © 2012-2013 European Middleware Initiative. All Rights Reserved.