1 /*
   2  * Copyright (c) 2017, Red Hat, Inc. and/or its affiliates.
   3  * 
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  */
  24 
  25 package javax.net.ssl;
  26 
  27 import java.util.EventListener;
  28 
  29 /**
  30  * This interface is implemented by any class which wants to receive
  31  * information of or control an ongoing SSL handshake.
  32  *
  33  * @see HandshakeCompletedListener
  34  * 
  35  * @since 10
  36  * @author Martin Balao
  37  */
  38 public interface HandshakeListener extends EventListener {
  39     /**
  40      * This method is invoked after verify data between a client
  41      * and a server has been exchanged in Finished messages of
  42      * an SSL handshake.
  43      *
  44      * @param event object containing information about client
  45      *              and server verify data.
  46      */
  47     default void finishedVerifyData(HandshakeVerifyDataEvent event) {
  48     }
  49 
  50     /**
  51      * This method is synchronously invoked when a renegotiation
  52      * is requested by the peer of an SSL handshake, and returns
  53      * whether or not the renegotiation should proceed. Temporarily
  54      * disabling renegotiations is encouraged while using TLS binding
  55      * values on an upper layer for authentication.
  56      *
  57      * @return whether or not a renegotiation should proceed.
  58      */
  59     default boolean renegotiationEnabled() {
  60         return true;
  61     }
  62 }