Class DirectoryTrustAnchorStore
- java.lang.Object
-
- eu.emi.security.authn.x509.helpers.trust.AbstractTrustAnchorStore
-
- eu.emi.security.authn.x509.helpers.trust.TimedTrustAnchorStoreBase
-
- eu.emi.security.authn.x509.helpers.trust.DirectoryTrustAnchorStore
-
- All Implemented Interfaces:
TrustAnchorStore
- Direct Known Subclasses:
OpensslTrustAnchorStoreImpl
public class DirectoryTrustAnchorStore extends TimedTrustAnchorStoreBase
Retrieves CA certificates from locations given as local paths with wildcards or URLs.- Author:
- K. Benedyczak
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<TrustAnchorExt>
anchors
protected CertificateUtils.Encoding
encoding
-
Fields inherited from class eu.emi.security.authn.x509.helpers.trust.AbstractTrustAnchorStore
observers
-
-
Constructor Summary
Constructors Modifier Constructor Description DirectoryTrustAnchorStore(java.util.List<java.lang.String> locations, java.lang.String diskCache, int connectionTimeout, java.util.Timer t, long updateInterval, CertificateUtils.Encoding encoding, ObserversHandler listeners)
protected
DirectoryTrustAnchorStore(java.util.List<java.lang.String> locations, java.lang.String diskCache, int connectionTimeout, java.util.Timer t, long updateInterval, CertificateUtils.Encoding encoding, ObserversHandler observers, boolean noFirstUpdate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getCacheDir()
int
getConnTimeout()
CertificateUtils.Encoding
getEncoding()
java.util.List<java.lang.String>
getLocations()
java.util.Set<java.security.cert.TrustAnchor>
getTrustAnchors()
java.security.cert.X509Certificate[]
getTrustedCertificates()
protected java.security.cert.X509Certificate[]
loadCerts(java.net.URL url)
protected void
reloadCerts(java.util.Collection<java.net.URL> locations)
For all URLs tries to load a CA cert.void
update()
1.-
Methods inherited from class eu.emi.security.authn.x509.helpers.trust.TimedTrustAnchorStoreBase
dispose, scheduleUpdate, setUpdateInterval
-
Methods inherited from class eu.emi.security.authn.x509.helpers.trust.AbstractTrustAnchorStore
checkValidity, getUpdateInterval
-
-
-
-
Field Detail
-
anchors
protected java.util.Set<TrustAnchorExt> anchors
-
encoding
protected CertificateUtils.Encoding encoding
-
-
Constructor Detail
-
DirectoryTrustAnchorStore
public DirectoryTrustAnchorStore(java.util.List<java.lang.String> locations, java.lang.String diskCache, int connectionTimeout, java.util.Timer t, long updateInterval, CertificateUtils.Encoding encoding, ObserversHandler listeners)
-
DirectoryTrustAnchorStore
protected DirectoryTrustAnchorStore(java.util.List<java.lang.String> locations, java.lang.String diskCache, int connectionTimeout, java.util.Timer t, long updateInterval, CertificateUtils.Encoding encoding, ObserversHandler observers, boolean noFirstUpdate)
-
-
Method Detail
-
loadCerts
protected java.security.cert.X509Certificate[] loadCerts(java.net.URL url) throws java.io.IOException, java.net.URISyntaxException, java.security.cert.CertificateEncodingException
- Throws:
java.io.IOException
java.net.URISyntaxException
java.security.cert.CertificateEncodingException
-
reloadCerts
protected void reloadCerts(java.util.Collection<java.net.URL> locations)
For all URLs tries to load a CA cert. Information for extensions: this method is guaranteed to be called once per update.- Parameters:
locations
- a collection of URLs
-
update
public 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 classTimedTrustAnchorStoreBase
-
getTrustAnchors
public java.util.Set<java.security.cert.TrustAnchor> getTrustAnchors()
-
getTrustedCertificates
public java.security.cert.X509Certificate[] getTrustedCertificates()
-
getLocations
public java.util.List<java.lang.String> getLocations()
-
getConnTimeout
public int getConnTimeout()
-
getCacheDir
public java.lang.String getCacheDir()
-
getEncoding
public CertificateUtils.Encoding getEncoding()
-
-