// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-

#ifndef __gnu_javax_net_ssl_provider_SSLSocket__
#define __gnu_javax_net_ssl_provider_SSLSocket__

#pragma interface

#include <javax/net/ssl/SSLSocket.h>
#include <gcj/array.h>

extern "Java"
{
  namespace javax
  {
    namespace net
    {
      namespace ssl
      {
        class X509KeyManager;
        class X509TrustManager;
        class SSLSession;
        class HandshakeCompletedListener;
      }
    }
  }
  namespace gnu
  {
    namespace java
    {
      namespace security
      {
        namespace sig
        {
          class ISignature;
        }
        namespace hash
        {
          class IMessageDigest;
        }
      }
    }
    namespace javax
    {
      namespace net
      {
        namespace ssl
        {
          class SRPTrustManager;
          namespace provider
          {
            class SSLSocket;
            class CipherSuite;
            class Finished;
            class ProtocolVersion;
            class Alert;
            class RecordInput;
            class Session;
            class SessionContext;
          }
        }
      }
    }
  }
  namespace java
  {
    namespace math
    {
      class BigInteger;
    }
    namespace security
    {
      namespace cert
      {
        class X509Certificate;
      }
      class SecureRandom;
    }
    namespace nio
    {
      namespace channels
      {
        class SocketChannel;
      }
    }
    namespace net
    {
      class SocketAddress;
      class InetAddress;
      class Socket;
    }
  }
}

class gnu::javax::net::ssl::provider::SSLSocket : public ::javax::net::ssl::SSLSocket
{
public: // actually package-private
  SSLSocket (::java::net::Socket *, ::java::lang::String *, jint, jboolean);
  SSLSocket (::java::net::Socket *, ::java::nio::channels::SocketChannel *);
  SSLSocket ();
  SSLSocket (::java::net::InetAddress *, jint);
  SSLSocket (::java::net::InetAddress *, jint, ::java::net::InetAddress *, jint);
  SSLSocket (::java::lang::String *, jint);
  SSLSocket (::java::lang::String *, jint, ::java::net::InetAddress *, jint);
private:
  void initialize ();
public:
  virtual void addHandshakeCompletedListener (::javax::net::ssl::HandshakeCompletedListener *);
  virtual void removeHandshakeCompletedListener (::javax::net::ssl::HandshakeCompletedListener *);
  virtual JArray< ::java::lang::String *> *getEnabledProtocols ();
  virtual void setEnabledProtocols (JArray< ::java::lang::String *> *);
  virtual JArray< ::java::lang::String *> *getSupportedProtocols ();
  virtual JArray< ::java::lang::String *> *getEnabledCipherSuites ();
  virtual void setEnabledCipherSuites (JArray< ::java::lang::String *> *);
  virtual JArray< ::java::lang::String *> *getSupportedCipherSuites ();
  virtual ::javax::net::ssl::SSLSession *getSession () { return reinterpret_cast< ::javax::net::ssl::SSLSession *> (session); }
  virtual jboolean getEnableSessionCreation () { return createSessions; }
  virtual void setEnableSessionCreation (jboolean);
  virtual jboolean getNeedClientAuth () { return needClientAuth; }
  virtual void setNeedClientAuth (jboolean);
  virtual jboolean getWantClientAuth () { return wantClientAuth; }
  virtual void setWantClientAuth (jboolean);
  virtual jboolean getUseClientMode () { return clientMode; }
  virtual void setUseClientMode (jboolean);
  virtual void startHandshake ();
  virtual ::java::net::InetAddress *getInetAddress ();
  virtual ::java::net::InetAddress *getLocalAddress ();
  virtual jint getPort ();
  virtual jint getLocalPort ();
  virtual ::java::io::InputStream *getInputStream ();
  virtual ::java::io::OutputStream *getOutputStream ();
  virtual void setTcpNoDelay (jboolean);
  virtual jboolean getTcpNoDelay ();
  virtual void setSoLinger (jboolean, jint);
  virtual jint getSoLinger ();
  virtual void sendUrgentData (jint);
  virtual void setSoTimeout (jint);
  virtual jint getSoTimeout ();
  virtual void setSendBufferSize (jint);
  virtual jint getSendBufferSize ();
  virtual void setReceiveBufferSize (jint);
  virtual jint getReceiveBufferSize ();
  virtual void close ();
  virtual ::java::lang::String *toString ();
  virtual void connect (::java::net::SocketAddress *);
  virtual void connect (::java::net::SocketAddress *, jint);
  virtual void bind (::java::net::SocketAddress *);
  virtual ::java::net::SocketAddress *getLocalSocketAddress ();
  virtual ::java::nio::channels::SocketChannel *getChannel () { return channel; }
  virtual jboolean isBound ();
  virtual jboolean isClosed ();
  virtual ::java::net::SocketAddress *getRemoteSocketAddress ();
  virtual void setOOBInline (jboolean);
  virtual jboolean getOOBInline ();
  virtual void setKeepAlive (jboolean);
  virtual jboolean getKeepAlive ();
  virtual void setTrafficClass (jint);
  virtual jint getTrafficClass ();
  virtual void setReuseAddress (jboolean);
  virtual jboolean getReuseAddress ();
  virtual void shutdownInput ();
  virtual void shutdownOutput ();
  virtual jboolean isConnected ();
  virtual jboolean isInputShutdown ();
  virtual jboolean isOutputShutdown ();
public:  // actually protected
  virtual void finalize ();
public: // actually package-private
  virtual void setSessionContext (::gnu::javax::net::ssl::provider::SessionContext *);
  virtual void setEnabledCipherSuites (::java::util::List *);
  virtual void setEnabledProtocols (::java::util::SortedSet *);
  virtual void setSRPTrustManager (::gnu::javax::net::ssl::SRPTrustManager *);
  virtual void setTrustManager (::javax::net::ssl::X509TrustManager *);
  virtual void setKeyManager (::javax::net::ssl::X509KeyManager *);
  virtual void setRandom (::java::security::SecureRandom *);
  virtual void sendAlert (::gnu::javax::net::ssl::provider::Alert *);
  virtual ::gnu::javax::net::ssl::provider::Alert *checkAlert ();
  virtual void checkHandshakeDone ();
private:
  void changeCipherSpec ();
  void readChangeCipherSpec ();
  void setupIO ();
  void handshakeCompleted ();
  void doClientHandshake ();
  void doServerHandshake ();
  JArray<jbyteArray> * generateKeys (jbyteArray, jbyteArray, ::gnu::javax::net::ssl::provider::ProtocolVersion *);
  ::gnu::javax::net::ssl::provider::Finished *generateFinished (::gnu::javax::net::ssl::provider::ProtocolVersion *, ::gnu::java::security::hash::IMessageDigest *, ::gnu::java::security::hash::IMessageDigest *, jboolean);
  ::gnu::javax::net::ssl::provider::Alert *unexpectedMessage ();
  void throwUnexpectedMessage ();
  ::gnu::javax::net::ssl::provider::Alert *handshakeFailure ();
  void throwHandshakeFailure ();
  ::gnu::javax::net::ssl::provider::Alert *internalError ();
  void throwInternalError ();
  ::gnu::javax::net::ssl::provider::Alert *peerUnverified (JArray< ::java::security::cert::X509Certificate *> *);
  void throwPeerUnverified (JArray< ::java::security::cert::X509Certificate *> *);
  ::gnu::javax::net::ssl::provider::CipherSuite *selectSuite (::java::util::List *, ::gnu::javax::net::ssl::provider::ProtocolVersion *);
  ::java::lang::String *askUserName (::java::lang::String *);
  ::java::lang::String *askPassword (::java::lang::String *);
  jboolean checkCertificates (JArray< ::java::security::cert::X509Certificate *> *);
  void updateSig (::gnu::java::security::sig::ISignature *, ::java::math::BigInteger *);
  void fatal ();
  static const jint DEBUG_HANDSHAKE_LAYER = 1L;
  static const jint DEBUG_KEY_EXCHANGE = 0L;
  static ::java::util::logging::Logger *logger;
  ::java::net::Socket * __attribute__((aligned(__alignof__( ::javax::net::ssl::SSLSocket )))) underlyingSocket;
  jint underlyingPort;
  jboolean autoClose;
public: // actually package-private
  ::gnu::javax::net::ssl::provider::SessionContext *sessionContext;
  ::gnu::javax::net::ssl::provider::Session *session;
  ::java::util::LinkedList *handshakeListeners;
private:
  jboolean clientMode;
  jboolean wantClientAuth;
  jboolean needClientAuth;
  jboolean createSessions;
  jboolean handshakeDone;
  ::java::lang::String *remoteHost;
  ::java::io::InputStream *socketIn;
  ::java::io::OutputStream *socketOut;
  ::java::io::InputStream *applicationIn;
  ::java::io::OutputStream *applicationOut;
  ::java::io::InputStream *handshakeIn;
  ::java::io::OutputStream *handshakeOut;
public: // actually package-private
  ::gnu::javax::net::ssl::provider::RecordInput *recordInput;
private:
  jlong handshakeTime;
  ::java::nio::channels::SocketChannel *channel;
public: // actually package-private
  static ::java::util::SortedSet *supportedProtocols;
  static ::java::util::List *supportedSuites;
private:
  static jbyteArray SENDER_CLIENT;
  static jbyteArray SENDER_SERVER;
public:

  static ::java::lang::Class class$;
};

#endif /* __gnu_javax_net_ssl_provider_SSLSocket__ */
