Java 8 SSLEngineResult.HandshakeStatus - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 SSLEngineResult.HandshakeStatus class.

This code example shows how to use the following methods:ordinal
import javax.net.ssl.SSLEngineResult; 
import javax.net.ssl.SSLEngineResult.HandshakeStatus; 
import javax.net.ssl.SSLEngineResult.Status; 
import javax.net.ssl.SSLException; 
 
public class SecureSocketWrapper implements SocketWrapper { 
  private final SocketChannel channel;
  private final SSLEngine     sslEngine;
 
  private final ByteBuffer    in;
  private final ByteBuffer    unwrappedIn;
  private final ByteBuffer    out;
  private final ByteBuffer    empty;
 
  private boolean             isPuttingInUnwrappedInBuffer = true;
  private boolean             isPuttingInInBuffer          = true;
  private boolean             isPuttingInOutBuffer         = true;
  private Status lastStatus;
 
  public SecureSocketWrapper(SocketWrapper wrapper) throws NoSuchAlgorithmException {
5
CodeRank
This code example shows how to use the following methods:ordinal
 * the SslFilter class, in the same package 
 * 
 * @author <a href="http://mina.apache.org">Apache MINA Project</a> 
 */ 
/** No qualifier*/ 
class SslHandler { 
    /** A logger for this class */ 
    private final static Logger LOGGER = LoggerFactory.getLogger(SslHandler.class); 
 
    /** The SSL Filter which has created this handler */ 
    private final SslFilter sslFilter;
 
    /** The current session */ 
    private final IoSession session;
 
    private final Queue<IoFilterEvent> preHandshakeEventQueue = new ConcurrentLinkedQueue<IoFilterEvent>();
 
    private final Queue<IoFilterEvent> filterWriteEventQueue = new ConcurrentLinkedQueue<IoFilterEvent>();
 
    /** A queue used to stack all the incoming data until the SSL session is established */ 
3
CodeRank
This code example shows how to use the following methods:ordinal
 * None of its methods are public as they should not be used by any other class but from 
 * the SslFilter class, in the same package 
 * 
 * @author <a href="http://mina.apache.org">Apache MINA Project</a> 
 */ 
/** No qualifier*/ class SslHandler { 
    /** A logger for this class */ 
    private final static Logger LOGGER = LoggerFactory.getLogger(SslHandler.class); 
     
    /** The SSL Filter which has created this handler */ 
    private final SslFilter sslFilter;
     
    /** The current session */ 
    private final IoSession session;
     
    private final Queue<IoFilterEvent> preHandshakeEventQueue = new ConcurrentLinkedQueue<IoFilterEvent>();
    private final Queue<IoFilterEvent> filterWriteEventQueue = new ConcurrentLinkedQueue<IoFilterEvent>();
     
    /** A queue used to stack all the incoming data until the SSL session is established */ 
    private final Queue<IoFilterEvent> messageReceivedEventQueue = new ConcurrentLinkedQueue<IoFilterEvent>();
3
CodeRank
This code example shows how to use the following methods:ordinal
 *  
 * @author Niall Gallagher 
 *  
 * @see org.simpleframework.transport.Negotiator 
 */ 
class Handshake implements Negotiation { 
 
    /** 
     * This is the negotiator used to process the secure transport. 
     */ 
    private final Negotiator negotiator;
 
    /** 
     * This is the socket channel used to read and write data to. 
     */ 
    private final SocketChannel channel;
 
    /** 
     * This is the transport dispatched when the negotiation ends. 
     */ 
3
CodeRank
This code example shows how to use the following methods:ordinal
            fail("Could not get SSLEngine: no such algorithm " + e.getMessage());
        } 
        return context.createSSLEngine(host, port);
    } 
 
    class HandshakeHandler implements Runnable {
 
        private final SSLEngine engine;
 
        private final SourceChannel in;
 
        private final SinkChannel out;
 
        private final ByteBuffer EMPTY = ByteBuffer.allocate(0);
 
        @SuppressWarnings("unused") 
        private final String LOGTAG;
 
        private SSLEngineResult.HandshakeStatus status;
 
2
CodeRank
This code example shows how to use the following methods:ordinal
 
// SSL Debugging: 
// http://java.sun.com/j2se/1.5.0/docs/guide/security/jsse/JSSERefGuide.html#Debug 
// -Djavax.net.debug=ssl:handshake 
 
public abstract class SecurableSession extends Session implements IEncrypt {
 
	private SSLEngine sslEngine;
	private IEncrypt encrypter;
	 
	private boolean secured;
 
	protected enum ConnectMessageState { 
		NONE, PARTIAL, FULL
	} 
 
	protected SecurableSession(int sessionID, PacketSourceType sourceType, ByteChannel senderChannel,
		ByteChannel receiverChannel, SubscriberManager manager, IReadBytes byteReader, IWriteBytes byteWriter, String senderIP, int senderPort)
	{ 
		super(sessionID, sourceType, senderChannel, receiverChannel, manager, byteReader, byteWriter, senderIP, senderPort);
3
CodeRank
This code example shows how to use the following methods:ordinal
 * the corresponding the {@link ByteBuffer}. 
 * 
 * @author Artur Hefczyc 
 * @author Hao Chen 
 */ 
public class TLSWrapper { 
 
	private static final Logger Log = LoggerFactory.getLogger(TLSWrapper.class); 
 
    /* 
     * Enables logging of the SSLEngine operations. 
     */ 
    private boolean logging = false;
 
    /* 
     * Enables the JSSE system debugging system property: 
     * 
     * -Djavax.net.debug=all 
     * 
     * This gives a lot of low-level information about operations underway, including specific 
3
CodeRank
This code example shows how to use the following methods:ordinal
 * Implementation of a secure socket channel 
 * @author Filip Hanik 
 * @version 1.0 
 */ 
 
public class SecureNioChannel extends NioChannel  { 
     
    protected ByteBuffer netInBuffer;
    protected ByteBuffer netOutBuffer;
     
    protected SSLEngine sslEngine;
     
    protected boolean initHandshakeComplete = false;
    protected HandshakeStatus initHandshakeStatus; //gets set by begin handshake
     
    protected boolean closed = false;
    protected boolean closing = false;
     
    protected NioSelectorPool pool;
     
3
CodeRank
This code example shows how to use the following methods:ordinal
 
/** 
 * This class implements methods to read/write messages over an established 
 * socket channel. The data exchange is encrypted/decrypted by SSLEngine. 
 */ 
public class SecureMessageReadWriteService implements IMessageReadWrite { 
    private static final Logger logger = LoggerFactory 
            .getLogger(SecureMessageReadWriteService.class); 
 
    private Selector selector;
    private SelectionKey clientSelectionKey;
    private SocketChannel socket;
    private BasicFactory factory;
 
    private SSLEngine sslEngine;
	private SSLEngineResult sslEngineResult;   	// results from sslEngine last operation
    private ByteBuffer myAppData;				// clear text message to be sent
    private ByteBuffer myNetData;   			// encrypted message to be sent
    private ByteBuffer peerAppData;				// clear text message received from the switch
    private ByteBuffer peerNetData; 			// encrypted message from the switch
3
CodeRank
This code example shows how to use the following methods:ordinal
import org.apache.commons.logging.LogFactory; 
import org.limewire.nio.ByteBufferCache; 
import org.limewire.util.BufferUtils; 
 
/** A simple test that connects two SSLEngines and ensures SSL works. */ 
public class SSLEngineTest { 
     
    private static final Log LOG = LogFactory.getLog(SSLEngineTest.class);
     
    private final SSLContext context;
    private final String[] cipherSuites;
    private final ByteBufferCache cache;
     
    private Throwable lastFailureCause;
     
    public SSLEngineTest(SSLContext context, String[] cipherSuites, ByteBufferCache cache) {
        this.context = context;
        this.cipherSuites = cipherSuites;
        this.cache = cache;
    } 
4
CodeRank
See Code Examples for Java 8 SSLEngineResult.HandshakeStatus Methods: