Package eu.emi.security.authn.x509
Class OCSPParametes
- java.lang.Object
-
- eu.emi.security.authn.x509.OCSPParametes
-
public class OCSPParametes extends java.lang.Object
Manages configuration of OCSP support for all truststores.- Author:
- K. Benedyczak
-
-
Field Summary
Fields Modifier and Type Field Description protected int
cacheTtl
protected OCSPCheckingMode
checkingMode
protected int
conntectTimeout
static int
DEFAULT_CACHE
static int
DEFAULT_TIMEOUT
protected java.lang.String
diskCachePath
protected OCSPResponder[]
localResponders
protected boolean
preferLocalResponders
protected boolean
useNonce
-
Constructor Summary
Constructors Constructor Description OCSPParametes()
Default constructor usingOCSPCheckingMode.IF_AVAILABLE
.OCSPParametes(OCSPCheckingMode checkingMode)
Constructor without any local responders and default settings.OCSPParametes(OCSPCheckingMode checkingMode, OCSPResponder localResponder)
Uses default settings for timeout (DEFAULT_TIMEOUT
), and cache (DEFAULT_CACHE
and no disk persistence of cached responses), prefers local responders, do not sign requests and do not use nonce.OCSPParametes(OCSPCheckingMode checkingMode, OCSPResponder[] localResponders, int conntectTimeout, boolean preferLocalResponders, boolean useNonce, int cacheTtl, java.lang.String diskCachePath)
Full constructorOCSPParametes(OCSPCheckingMode checkingMode, OCSPResponder[] localResponders, int cacheTtl, java.lang.String diskCachePath)
Uses default settings for timeout (DEFAULT_TIMEOUT
), prefers local responders, do not sign requests and do not use nonce.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCacheTtl()
OCSPCheckingMode
getCheckingMode()
int
getConntectTimeout()
java.lang.String
getDiskCachePath()
OCSPResponder[]
getLocalResponders()
boolean
isPreferLocalResponders()
boolean
isUseNonce()
void
setCacheTtl(int cacheTtl)
void
setCheckingMode(OCSPCheckingMode checkingMode)
void
setConntectTimeout(int conntectTimeout)
void
setDiskCachePath(java.lang.String diskCachePath)
void
setLocalResponders(OCSPResponder[] localResponders)
void
setPreferLocalResponders(boolean preferLocalResponders)
void
setUseNonce(boolean useNonce)
-
-
-
Field Detail
-
DEFAULT_TIMEOUT
public static final int DEFAULT_TIMEOUT
- See Also:
- Constant Field Values
-
DEFAULT_CACHE
public static final int DEFAULT_CACHE
- See Also:
- Constant Field Values
-
checkingMode
protected OCSPCheckingMode checkingMode
-
localResponders
protected OCSPResponder[] localResponders
-
conntectTimeout
protected int conntectTimeout
-
preferLocalResponders
protected boolean preferLocalResponders
-
useNonce
protected boolean useNonce
-
cacheTtl
protected int cacheTtl
-
diskCachePath
protected java.lang.String diskCachePath
-
-
Constructor Detail
-
OCSPParametes
public OCSPParametes()
Default constructor usingOCSPCheckingMode.IF_AVAILABLE
.- See Also:
OCSPParametes(OCSPCheckingMode)
-
OCSPParametes
public OCSPParametes(OCSPCheckingMode checkingMode)
Constructor without any local responders and default settings.- Parameters:
checkingMode
- general checking mode- See Also:
OCSPParametes(OCSPCheckingMode, OCSPResponder)
-
OCSPParametes
public OCSPParametes(OCSPCheckingMode checkingMode, OCSPResponder localResponder)
Uses default settings for timeout (DEFAULT_TIMEOUT
), and cache (DEFAULT_CACHE
and no disk persistence of cached responses), prefers local responders, do not sign requests and do not use nonce. Uses only a single local responder.- Parameters:
checkingMode
- general checking modelocalResponder
- a single local responder
-
OCSPParametes
public OCSPParametes(OCSPCheckingMode checkingMode, OCSPResponder[] localResponders, int cacheTtl, java.lang.String diskCachePath)
Uses default settings for timeout (DEFAULT_TIMEOUT
), prefers local responders, do not sign requests and do not use nonce.- Parameters:
checkingMode
- general checking modelocalResponders
- list of local responders (can be empty, but not null)cacheTtl
- maximum time after each cached response expires. Negative for no cache at all, 0 for no limit (i.e. caching time will be only controlled by the OCSP response validity period). In s.diskCachePath
- if not null, cached responses will be stored on disk.
-
OCSPParametes
public OCSPParametes(OCSPCheckingMode checkingMode, OCSPResponder[] localResponders, int conntectTimeout, boolean preferLocalResponders, boolean useNonce, int cacheTtl, java.lang.String diskCachePath)
Full constructor- Parameters:
checkingMode
- general checking modelocalResponders
- list of local responders (can be empty, but not null)conntectTimeout
- OCSP responder connection and communication timeoutpreferLocalResponders
- whether to prefer locally defined responders over certificate-defined responderuseNonce
- whether to use in request and require in response the noncecacheTtl
- maximum time after each cached response expires. Negative for no cache at all, 0 for no limit (i.e. caching time will be only controlled by the OCSP response validity period). In s.diskCachePath
- if not null, cached responses will be stored on disk.
-
-
Method Detail
-
getCheckingMode
public OCSPCheckingMode getCheckingMode()
- Returns:
- the checkingMode
-
setCheckingMode
public void setCheckingMode(OCSPCheckingMode checkingMode)
- Parameters:
checkingMode
- the checkingMode to set
-
getLocalResponders
public OCSPResponder[] getLocalResponders()
- Returns:
- the localResponders
-
setLocalResponders
public void setLocalResponders(OCSPResponder[] localResponders)
- Parameters:
localResponders
- the localResponders to set
-
getConntectTimeout
public int getConntectTimeout()
- Returns:
- the conntectTimeout
-
setConntectTimeout
public void setConntectTimeout(int conntectTimeout)
- Parameters:
conntectTimeout
- the conntectTimeout to set
-
isPreferLocalResponders
public boolean isPreferLocalResponders()
- Returns:
- the preferLocalResponders
-
setPreferLocalResponders
public void setPreferLocalResponders(boolean preferLocalResponders)
- Parameters:
preferLocalResponders
- the preferLocalResponders to set
-
isUseNonce
public boolean isUseNonce()
- Returns:
- the useNonce
-
setUseNonce
public void setUseNonce(boolean useNonce)
- Parameters:
useNonce
- the useNonce to set
-
getCacheTtl
public int getCacheTtl()
- Returns:
- the cacheTtl
-
setCacheTtl
public void setCacheTtl(int cacheTtl)
- Parameters:
cacheTtl
- the cacheTtl to set
-
getDiskCachePath
public java.lang.String getDiskCachePath()
- Returns:
- the diskCachePath
-
setDiskCachePath
public void setDiskCachePath(java.lang.String diskCachePath)
- Parameters:
diskCachePath
- the diskCachePath to set
-
-