[Development] java: Implement TLS security type. (Martin Koegler)


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4199 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/java/src/com/tigervnc/vncviewer/RfbProto.java b/java/src/com/tigervnc/vncviewer/RfbProto.java
index a0aade0..eb8ca93 100644
--- a/java/src/com/tigervnc/vncviewer/RfbProto.java
+++ b/java/src/com/tigervnc/vncviewer/RfbProto.java
@@ -431,6 +431,9 @@
 		case SecTypeNone:
 		case SecTypeVncAuth:
 		case SecTypePlain:
+		case SecTypeTLSNone:
+		case SecTypeTLSVnc:
+		case SecTypeTLSPlain:
 		    writeInt(secTypes[i]);
 		    return secTypes[i];
 		}
@@ -476,6 +479,11 @@
     readSecurityResult("VNC authentication");
   }
 
+    void authenticateTLS() throws Exception {
+	TLSTunnel tunnel = new TLSTunnel(sock);
+	tunnel.setup (this);
+    }
+
     void authenticatePlain(String User, String Password) throws Exception {
       byte[] user=User.getBytes();
       byte[] password=Password.getBytes();
@@ -1545,4 +1553,9 @@
     numBytesRead += 4;
     return r;
   }
+
+  public void setStreams(InputStream is_, OutputStream os_) {
+    is = new DataInputStream(is_);
+    os = os_;
+  }
 }