title: Bouncy Castle TLS API usage
body: <p>I want to communicate between Server and Client using sockets using bouncy castle TLS library.
  I went through many documentation(which was insufficient for me) but I did not get any idea how to do this,</p>
  
  <p>I am using <strong>BouncyCastle v1.7.48</strong>(runtime version=v2.0.50727) binary,
  and I have found these info,</p>
  
  <p>I have to use, <code>Org.BouncyCastle.Crypto.Tls</code> namespace and <code>TlsProtocolHandler</code> class.</p>
  
  <p>To achieve TLS communication, </p>
  
  <ol>
  <li>what API I should use in server side?</li>
  <li><p>what API I should use in client side?</p>
  
  <pre><code>    System.IO.Stream inputStream, outputStream;
      TlsProtocolHandler tls = new TlsProtocolHandler(inputStream, outputStream);
  </code></pre></li>
  <li><p>What are the parameters <code>inputStream</code> and <code>outputStream</code>?</p></li>
  </ol>
  
  <blockquote>
    <p><strong>public virtual void Connect(TlsClient tlsClient);</strong></p>
  </blockquote>
  
  <p>where, <code>TlsClient</code> is an <strong>interface</strong>, and that <strong>contains many</strong> interfaces <strong>inside</strong>.</p>
  
  <p><strong>4. How to use the above API? I have to declare new classes and implement methods inside that to all?</strong></p>
  
  <p>Please help me with this Bouncy Castle. </p>
  
  <p><strong>EDIT 1:</strong>
  I created one class which inherits from an abstract class called <code>DefaultTlsClient</code>.
  Then I could create an instance of my class and pass it for interface reference.
  So I could send the parameter like this. <code>tls.Connect(tlsClient);</code></p>
  
  <p>I am not initializing any parameters except I mentioned above.
  (Sockets are connected before these operation on 2055)
  But I am not sure handshake is complete or not. My program will go to reading state.</p>