com.wolfssl
Interface WolfSSLGenCookieCallback


public interface WolfSSLGenCookieCallback

wolfSSL I/O Receive Callback Interface. This interface specifies how applicaitons should implement the DTLS cookie generation callback class to be used by wolfSSL.

After implementing this interface, it should be passed as a parameter to the WolfSSLContext.setGenCookie() method to be registered with the native wolfSSL library.

Version:
1.0, August 2013
Author:
wolfSSL

Method Summary
 int genCookieCallback(WolfSSLSession ssl, byte[] buf, int sz, java.lang.Object ctx)
          DTLS cookie generation callback method.
 

Method Detail

genCookieCallback

int genCookieCallback(WolfSSLSession ssl,
                      byte[] buf,
                      int sz,
                      java.lang.Object ctx)
DTLS cookie generation callback method. This method acts as the cookie generation callback to be used with wolfSSL's DTLS implementation. This can be registered with an SSL context using the WolfSSLContext#setGenCookie(WolfSSLGenCookieCallback) method.

Parameters:
ssl - the current SSL session object from which the callback was initiated.
buf - buffer in which the application should place generated cookie.
sz - size of buffer, buf
ctx - cookie context to be used
Returns:
the size of the cookie generated, or WolfSSL.GEN_COOKIE_E upon error.