|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.wolfssl.WolfSSL
public class WolfSSL
Base class which wraps the native WolfSSL embedded SSL library. This class contains library init and cleanup methods, general callback methods, as well as error codes and general wolfSSL codes.
Field Summary | |
---|---|
static int |
ASN_INPUT_E
ASN input error, not enough data |
static int |
BAD_FUNC_ARG
Bad function argument provided |
static int |
BAD_MUTEX_ERROR
Bad mutex |
static int |
BAD_PATH_ERROR
Bad path for opendir |
static int |
BUFFER_E
Output buffer too small or input too large |
static int |
CACHE_MATCH_ERROR
Cache header match error |
static int |
CYASSL_AEAD_TYPE
|
static int |
cyassl_aes
|
static int |
cyassl_aes_ccm
|
static int |
cyassl_aes_gcm
|
static int |
CYASSL_BLOCK_TYPE
|
static int |
CYASSL_CBIO_ERR_CONN_CLOSE
|
static int |
CYASSL_CBIO_ERR_CONN_RST
|
static int |
CYASSL_CBIO_ERR_GENERAL
|
static int |
CYASSL_CBIO_ERR_ISR
|
static int |
CYASSL_CBIO_ERR_TIMEOUT
|
static int |
CYASSL_CBIO_ERR_WANT_READ
|
static int |
CYASSL_CBIO_ERR_WANT_WRITE
|
static int |
cyassl_cipher_null
|
static int |
CYASSL_CLIENT_END
|
static int |
CYASSL_CRL_CHECKALL
|
static int |
CYASSL_CRL_MONITOR
Monitor this CRL directory flag |
static int |
CYASSL_CRL_START_MON
Start CRL monitoring flag |
static int |
cyassl_des
|
static int |
cyassl_des40
|
static int |
cyassl_hc128
|
static int |
cyassl_idea
|
static int |
CYASSL_OCSP_ENABLE
|
static int |
CYASSL_OCSP_NO_NONCE
|
static int |
CYASSL_OCSP_URL_OVERRIDE
|
static int |
cyassl_rabbit
|
static int |
cyassl_rc2
|
static int |
cyassl_rc4
|
static int |
CYASSL_SERVER_END
|
static int |
CYASSL_STREAM_TYPE
|
static int |
CYASSL_TLS_HMAC_INNER_SZ
|
static int |
cyassl_triple_des
|
static int |
GEN_COOKIE_E
|
static int |
MD5
|
static int |
MEMORY_E
Out of memory error |
static int |
MONITOR_RUNNING_E
CRL Monitor already running |
static int |
NO_PASSWORD
No password provided by user |
static int |
NOT_COMPILED_IN
Feature not compiled in |
static int |
SHA
|
static int |
SHA256
|
static int |
SHA384
|
static int |
SHA512
|
static int |
SSL_BAD_CERTTYPE
|
static int |
SSL_BAD_FILE
|
static int |
SSL_BAD_FILETYPE
|
static int |
SSL_BAD_PATH
|
static int |
SSL_BAD_STAT
|
static int |
SSL_ERROR_NONE
|
static int |
SSL_ERROR_SSL
|
static int |
SSL_ERROR_SYSCALL
|
static int |
SSL_ERROR_WANT_ACCEPT
|
static int |
SSL_ERROR_WANT_CONNECT
|
static int |
SSL_ERROR_WANT_READ
|
static int |
SSL_ERROR_WANT_WRITE
|
static int |
SSL_ERROR_WANT_X509_LOOKUP
|
static int |
SSL_ERROR_ZERO_RETURN
|
static int |
SSL_FAILURE
|
static int |
SSL_FATAL_ERROR
|
static int |
SSL_FILETYPE_ASN1
|
static int |
SSL_FILETYPE_DEFAULT
ASN1 |
static int |
SSL_FILETYPE_PEM
|
static int |
SSL_FILETYPE_RAW
NTRU raw key blog |
static int |
SSL_HANDSHAKE_FAILURE
|
static int |
SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER
|
static int |
SSL_NOT_IMPLEMENTED
|
static int |
SSL_OP_NO_SSLv2
|
static int |
SSL_R_SSLV3_ALERT_BAD_CERTIFICATE
|
static int |
SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN
|
static int |
SSL_R_TLSV1_ALERT_UNKNOWN_CA
|
static int |
SSL_RECEIVED_SHUTDOWN
|
static int |
SSL_SENT_SHUTDOWN
|
static int |
SSL_SESS_CACHE_BOTH
|
static int |
SSL_SESS_CACHE_CLIENT
|
static int |
SSL_SESS_CACHE_NO_AUTO_CLEAR
|
static int |
SSL_SESS_CACHE_NO_INTERNAL_LOOKUP
|
static int |
SSL_SESS_CACHE_OFF
|
static int |
SSL_SESS_CACHE_SERVER
|
static int |
SSL_SUCCESS
|
static int |
SSL_UNKNOWN
|
static int |
SSL_VERIFY_CLIENT_ONCE
|
static int |
SSL_VERIFY_FAIL_IF_NO_PEER_CERT
Verification mode for peer certificates. |
static int |
SSL_VERIFY_NONE
Verification mode for peer certificates. |
static int |
SSL_VERIFY_PEER
Verification mode for peer certificates. |
static int |
THREAD_CREATE_E
Thread create error |
Constructor Summary | |
---|---|
WolfSSL()
Initializes the wolfSSL library for use. |
Method Summary | |
---|---|
static int |
cleanup()
Un-initializes the wolfSSL library from further use. |
static void |
debuggingOFF()
Turns off runtime debug log messages. |
static int |
debuggingON()
Turns on debug logging at runtime. |
static long |
DTLSv1_2_ClientMethod()
Indicates that the application is a client and will only support the DTLS 1.2 protocol. |
static long |
DTLSv1_2_ServerMethod()
Indicates that the application is a server and will only support the DTLS 1.2 protocol. |
static long |
DTLSv1_ClientMethod()
Indicates that the application is a client and will only support the DTLS 1.0 protocol. |
static long |
DTLSv1_ServerMethod()
Indicates that the application is a server and will only support the DTLS 1.0 protocol. |
static java.lang.String |
getErrorString(long errNumber)
Converts an error code returned by getError() into a more human- readable error string. |
static int |
getHmacMaxSize()
Returns the wolfSSL max HMAC digest size. |
static int |
getSessionCacheMemsize()
Gets how big the session cache save buffer needs to be. |
static void |
loadLibrary()
Loads JNI library; must be called prior to any other calls in this class. |
static void |
loadLibrary(java.lang.String libPath)
Load JNI library; must be called prior to any other calls in this package. |
static int |
memrestoreSessionCache(byte[] mem,
int sz)
Restores the persistant session cache from memory buffer. |
static int |
memsaveSessionCache(byte[] mem,
int sz)
Persists session cache to memory buffer. |
static int |
setLoggingCb(WolfSSLLoggingCallback cb)
Registers the callback to be used for Logging debug and trace messages. |
static long |
SSLv23_ClientMethod()
Indicates that the application is a client and will use the highest possible SSL/TLS version from SSL 3.0 up to TLS 1.2. |
static long |
SSLv23_ServerMethod()
Indicates that the application is a server and will use the highest possible SSL/TLS version from SSL 3.0 up to TLS 1.2. |
static long |
SSLv3_ClientMethod()
Indicates that the application is a client and will only support the SSL 3.0 protocol. |
static long |
SSLv3_ServerMethod()
Indicates that the application is a server and will only support the SSL 3.0 protocol. |
static long |
TLSv1_1_ClientMethod()
Indicates that the application is a client and will only support the TLS 1.1 protocol. |
static long |
TLSv1_1_ServerMethod()
Indicates that the application is a server and will only support the TLS 1.1 protocol. |
static long |
TLSv1_2_ClientMethod()
Indicates that the application is a client and will only support the TLS 1.2 protocol. |
static long |
TLSv1_2_ServerMethod()
Indicates that the application is a server and will only support the TLS 1.2 protocol. |
static long |
TLSv1_ClientMethod()
Indicates that the application is a client and will only support the TLS 1.0 protocol. |
static long |
TLSv1_ServerMethod()
Indicates that the application is a server and will only support the TLS 1.0 protocol. |
static byte[] |
x509_getDer(long x509)
Returns the DER-encoded form of the certificate pointed to by x509. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SSL_ERROR_NONE
public static final int SSL_FAILURE
public static final int SSL_SUCCESS
public static final int SSL_BAD_CERTTYPE
public static final int SSL_BAD_STAT
public static final int SSL_BAD_PATH
public static final int SSL_BAD_FILETYPE
public static final int SSL_BAD_FILE
public static final int SSL_NOT_IMPLEMENTED
public static final int SSL_UNKNOWN
public static final int SSL_FATAL_ERROR
public static final int SSL_FILETYPE_ASN1
public static final int SSL_FILETYPE_PEM
public static final int SSL_FILETYPE_DEFAULT
public static final int SSL_FILETYPE_RAW
public static final int SSL_VERIFY_NONE
Client mode: the client will not verify the certificate
received from the server and the handshake will continue as normal.
Server mode: the server will not send a certificate request
to the client. As such, client verification will not be enabled.
WolfSSLContext.setVerify(long, int, WolfSSLVerifyCallback)
,
Constant Field Valuespublic static final int SSL_VERIFY_PEER
Client mode: the client will verify the certificate received
from the server during the handshake. This is turned on by default
in CyaSSL, therefore, using this option has no effect.
Server mode: the server will send a certificate request to the
client and verify the client certificate which is received.
WolfSSLContext.setVerify(long, int, WolfSSLVerifyCallback)
,
Constant Field Valuespublic static final int SSL_VERIFY_FAIL_IF_NO_PEER_CERT
Client mode: no effect when used on the client side.
Server mode: the verification will fail on the server side
if the client fails to send a certificate when requested to do so
(when using SSL_VERIFY_PEER on the SSL server).
WolfSSLContext.setVerify(long, int, WolfSSLVerifyCallback)
,
Constant Field Valuespublic static final int SSL_VERIFY_CLIENT_ONCE
public static final int SSL_SESS_CACHE_OFF
public static final int SSL_SESS_CACHE_CLIENT
public static final int SSL_SESS_CACHE_SERVER
public static final int SSL_SESS_CACHE_BOTH
public static final int SSL_SESS_CACHE_NO_AUTO_CLEAR
public static final int SSL_SESS_CACHE_NO_INTERNAL_LOOKUP
public static final int SSL_ERROR_WANT_READ
public static final int SSL_ERROR_WANT_WRITE
public static final int SSL_ERROR_WANT_CONNECT
public static final int SSL_ERROR_WANT_ACCEPT
public static final int SSL_ERROR_SYSCALL
public static final int SSL_ERROR_WANT_X509_LOOKUP
public static final int SSL_ERROR_ZERO_RETURN
public static final int SSL_ERROR_SSL
public static final int CYASSL_CRL_CHECKALL
public static final int CYASSL_OCSP_ENABLE
public static final int CYASSL_OCSP_URL_OVERRIDE
public static final int CYASSL_OCSP_NO_NONCE
public static final int CYASSL_CBIO_ERR_GENERAL
public static final int CYASSL_CBIO_ERR_WANT_READ
public static final int CYASSL_CBIO_ERR_WANT_WRITE
public static final int CYASSL_CBIO_ERR_CONN_RST
public static final int CYASSL_CBIO_ERR_ISR
public static final int CYASSL_CBIO_ERR_CONN_CLOSE
public static final int CYASSL_CBIO_ERR_TIMEOUT
public static final int CYASSL_SERVER_END
public static final int CYASSL_CLIENT_END
public static final int CYASSL_BLOCK_TYPE
public static final int CYASSL_STREAM_TYPE
public static final int CYASSL_AEAD_TYPE
public static final int CYASSL_TLS_HMAC_INNER_SZ
public static final int cyassl_cipher_null
public static final int cyassl_rc4
public static final int cyassl_rc2
public static final int cyassl_des
public static final int cyassl_triple_des
public static final int cyassl_des40
public static final int cyassl_idea
public static final int cyassl_aes
public static final int cyassl_aes_gcm
public static final int cyassl_aes_ccm
public static final int cyassl_hc128
public static final int cyassl_rabbit
public static final int GEN_COOKIE_E
public static final int SSL_SENT_SHUTDOWN
public static final int SSL_RECEIVED_SHUTDOWN
public static final int SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER
public static final int SSL_OP_NO_SSLv2
public static final int SSL_HANDSHAKE_FAILURE
public static final int SSL_R_TLSV1_ALERT_UNKNOWN_CA
public static final int SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN
public static final int SSL_R_SSLV3_ALERT_BAD_CERTIFICATE
public static final int CYASSL_CRL_MONITOR
public static final int CYASSL_CRL_START_MON
public static final int BAD_MUTEX_ERROR
public static final int BAD_PATH_ERROR
public static final int MONITOR_RUNNING_E
public static final int THREAD_CREATE_E
public static final int CACHE_MATCH_ERROR
public static final int MEMORY_E
public static final int BUFFER_E
public static final int ASN_INPUT_E
public static final int BAD_FUNC_ARG
public static final int NOT_COMPILED_IN
public static final int NO_PASSWORD
public static final int MD5
public static final int SHA
public static final int SHA256
public static final int SHA512
public static final int SHA384
Constructor Detail |
---|
public WolfSSL() throws WolfSSLException
WolfSSLException
Method Detail |
---|
public static void loadLibrary() throws java.lang.UnsatisfiedLinkError
java.lang.UnsatisfiedLinkError
- if the library is not found.public static void loadLibrary(java.lang.String libPath) throws java.lang.UnsatisfiedLinkError
java.lang.UnsatisfiedLinkError
- if the library is not found.public static final long SSLv3_ServerMethod()
WolfSSLContext.newContext(long)
public static final long SSLv3_ClientMethod()
WolfSSLContext.newContext(long)
public static final long TLSv1_ServerMethod()
WolfSSLContext.newContext(long)
public static final long TLSv1_ClientMethod()
WolfSSLContext.newContext(long)
public static final long TLSv1_1_ServerMethod()
WolfSSLContext.newContext(long)
public static final long TLSv1_1_ClientMethod()
WolfSSLContext.newContext(long)
public static final long TLSv1_2_ServerMethod()
WolfSSLContext.newContext(long)
public static final long TLSv1_2_ClientMethod()
WolfSSLContext.newContext(long)
public static final long DTLSv1_ServerMethod()
WolfSSLContext.newContext(long)
public static final long DTLSv1_ClientMethod()
WolfSSLContext.newContext(long)
public static final long DTLSv1_2_ServerMethod()
WolfSSLContext.newContext(long)
public static final long DTLSv1_2_ClientMethod()
WolfSSLContext.newContext(long)
public static final long SSLv23_ServerMethod()
WolfSSLContext.newContext(long)
public static final long SSLv23_ClientMethod()
WolfSSLContext.newContext(long)
public static final java.lang.String getErrorString(long errNumber)
errNumber
- error code returned by getError()
errNumber
on success. On failure, this method returns a
String with the appropriate failure reason.WolfSSLSession.getError(long, int)
public static final int cleanup()
public static final int debuggingON()
SSL_SUCCESS
upon success. NOT_COMPILED_IN
if logging isnt' enabled for this wolfSSL build.debuggingOFF()
,
setLoggingCb(WolfSSLLoggingCallback)
public static final void debuggingOFF()
debuggingON()
,
setLoggingCb(WolfSSLLoggingCallback)
public static final int setLoggingCb(WolfSSLLoggingCallback cb)
cb
- Callback to be used for logging debug messages
SSL_ERROR_NONE
upon success,
BAD_FUNC_ARG
if input is null,
NOT_COMPILED_IN
if wolfSSL was not
compiled with debugging support enabled.debuggingON()
,
debuggingOFF()
public static int memsaveSessionCache(byte[] mem, int sz)
memrestoreSessionCache()
method.
mem
- buffer to store session cache insz
- size of the input buffer, mem
SSL_SUCCESS
on success,
SSL_FAILURE
on general failure,
BUFFER_E
if the memory buffer is too
small to store the session cache in,
BAD_MUTEX_ERROR
if the session cache
mutex lock failed,
BAD_FUNC_ARG
if invalid parameters are
used.memrestoreSessionCache(byte[], int)
,
getSessionCacheMemsize()
,
WolfSSLContext.memsaveCertCache(long, byte[], int, int[])
,
WolfSSLContext.memrestoreCertCache(long, byte[], int)
,
WolfSSLContext.getCertCacheMemsize(long)
public static int memrestoreSessionCache(byte[] mem, int sz)
mem
- buffer containing persistant session cache to be restoredsz
- size of the input buffer, mem
SSL_SUCCESS
upon success,
SSL_FAILURE
upon general failure,
BUFFER_E
if the memory buffer is too
small, CACHE_MATCH_ERROR
if the
session cache header match failed and there were
differences in how the cache and the current library
are configured, BAD_MUTEX_ERROR
if the session cache mutex lock failed,
BAD_FUNC_ARG
if invalid parameters are
used.memsaveSessionCache(byte[], int)
,
getSessionCacheMemsize()
,
WolfSSLContext.memsaveCertCache(long, byte[], int, int[])
,
WolfSSLContext.memrestoreCertCache(long, byte[], int)
,
WolfSSLContext.getCertCacheMemsize(long)
public static int getSessionCacheMemsize()
memsaveSessionCache(byte[], int)
,
memrestoreSessionCache(byte[], int)
,
WolfSSLContext.memsaveCertCache(long, byte[], int, int[])
,
WolfSSLContext.memrestoreCertCache(long, byte[], int)
,
WolfSSLContext.getCertCacheMemsize(long)
public static byte[] x509_getDer(long x509)
x509
- pointer (long) to a native CYASSL_X509 object. This
objects represents an X.509 certificate.
null
if the input buffer is null.public static int getHmacMaxSize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |