Package com.wolfssl.provider.jsse
Class WolfSSLAuthStore
- java.lang.Object
-
- com.wolfssl.provider.jsse.WolfSSLAuthStore
-
public class WolfSSLAuthStore extends java.lang.Object
Helper class used to store common settings, objects, etc.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
WolfSSLAuthStore(javax.net.ssl.KeyManager[] keyman, javax.net.ssl.TrustManager[] trustman, java.security.SecureRandom random, com.wolfssl.provider.jsse.WolfSSLAuthStore.TLS_VERSION version)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
addSession(WolfSSLImplementSSLSession session)
Add the session for possible resumptionprotected java.lang.String
getCertAlias()
protected com.wolfssl.provider.jsse.WolfSSLAuthStore.TLS_VERSION
getProtocolVersion()
protected java.security.SecureRandom
getSecureRandom()
protected WolfSSLImplementSSLSession
getSession(WolfSSLSession ssl)
Returns a new session, does not check/save for resumptionprotected WolfSSLImplementSSLSession
getSession(WolfSSLSession ssl, int port, java.lang.String host, boolean clientMode)
Returns either an existing session to use or creates a new session.protected javax.net.ssl.X509KeyManager
getX509KeyManager()
protected javax.net.ssl.X509TrustManager
getX509TrustManager()
protected void
setCertAlias(java.lang.String in)
-
-
-
Constructor Detail
-
WolfSSLAuthStore
protected WolfSSLAuthStore(javax.net.ssl.KeyManager[] keyman, javax.net.ssl.TrustManager[] trustman, java.security.SecureRandom random, com.wolfssl.provider.jsse.WolfSSLAuthStore.TLS_VERSION version) throws java.lang.IllegalArgumentException, java.security.KeyManagementException
- Parameters:
keyman
- key manager to usetrustman
- trust manager to userandom
- secure randomversion
- TLS protocol version to use- Throws:
java.lang.IllegalArgumentException
- when bad values are passed injava.security.KeyManagementException
- in the case that getting keys fails
-
-
Method Detail
-
getX509KeyManager
protected javax.net.ssl.X509KeyManager getX509KeyManager()
- Returns:
- get the key manager used
-
getX509TrustManager
protected javax.net.ssl.X509TrustManager getX509TrustManager()
- Returns:
- get the trust manager used
-
getSecureRandom
protected java.security.SecureRandom getSecureRandom()
- Returns:
- get secure random
-
getProtocolVersion
protected com.wolfssl.provider.jsse.WolfSSLAuthStore.TLS_VERSION getProtocolVersion()
- Returns:
- get the current protocol version set
-
setCertAlias
protected void setCertAlias(java.lang.String in)
- Parameters:
in
- alias to set for certificate used
-
getCertAlias
protected java.lang.String getCertAlias()
- Returns:
- alias name
-
getSession
protected WolfSSLImplementSSLSession getSession(WolfSSLSession ssl, int port, java.lang.String host, boolean clientMode)
Returns either an existing session to use or creates a new session. Can return null on error case or the case where session could not be created.- Parameters:
ssl
- WOLFSSL class to set in sessionport
- port number connecting tohost
- host connecting toclientMode
- if is client side then true- Returns:
- a new or reused SSLSession on success, null on failure
-
getSession
protected WolfSSLImplementSSLSession getSession(WolfSSLSession ssl)
Returns a new session, does not check/save for resumption- Parameters:
ssl
- WOLFSSL class to reference with new session- Returns:
- a new SSLSession on success
-
addSession
protected int addSession(WolfSSLImplementSSLSession session)
Add the session for possible resumption- Parameters:
session
- the session to add to stored session map- Returns:
- SSL_SUCCESS on success
-
-