Java Doc for SSLStreamConnection.java in  » 6.0-JDK-Modules » j2me » com » sun » midp » ssl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » com.sun.midp.ssl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.midp.ssl.SSLStreamConnection

SSLStreamConnection
public class SSLStreamConnection implements StreamConnection(Code)
The SSLStreamConnection class implements the StreamConnection interface. Data exchanged through a SSLStreamConnection is automatically protected by SSL. Currently, only SSL version 3.0 is supported and the list of cipher suites proposed by the client is hardcoded to {SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_EXPORT_WITH_RC4_40_MD5}. This version of the implementation does not support client authentication at the SSL layer -- a feature that is rarely used. Typical usage of this class by an application would be along the following lines:
 // create a TCP connection
 StreamConnection t = Connector.open("socket://www.server.com:443");
 // Create an SSL connection
 SSLStreamConnection s = new SSLStreamConnection("www.server.com", 443,
 t.openInputStream(), t.openOutputStream());
 t.close();
 // obtain the associated input/output streams
 OutputStream sout = s.openOutputStream();
 InputStream sin = s.openInputStream();
 ...
 // send SSL-protected data by writing to sout and
 // receive SSL-protected by reading from sin
 ...
 sin.close();
 sout.close();
 s.close();   // close the SSL connection when done
 


Field Summary
final static  intCLOSED
     Indicates that a stream is closed.
final static  intOPEN
     Indicates that a stream is opened.
final static  intREADY
     Indicates that a is ready to be opened.
 intinputStreamState
     State of the input stream given out by getInputStream.
 intoutputStreamState
     State of the output stream given out by getOutputStream.

Constructor Summary
public  SSLStreamConnection(String host, int port, InputStream in, OutputStream out, CertStore cs)
     Establish and SSL session over a reliable stream. This connection will forward the input and output stream close methods to the given connection.

Method Summary
 voidcleanupIfNeeded()
     Closes the SSL connection.
public synchronized  voidclose()
     Closes the SSL connection.
 StringgetCipherSuite()
     Returns the cipher suite in use for the connection.
public  SecurityInfogetSecurityInfo()
     Returns the security information associated with this connection.
public  X509CertificategetServerCertificate()
     Returns the server certificate associated with this connection.
public  DataInputStreamopenDataInputStream()
     Returns the DataInputStream associated with this SSLStreamConnection.
public  DataOutputStreamopenDataOutputStream()
     Returns the DataOutputStream associated with this SSLStreamConnection.
public synchronized  InputStreamopenInputStream()
     Returns the InputStream associated with this SSLStreamConnection.
public synchronized  OutputStreamopenOutputStream()
     Returns the OutputStream associated with this SSLStreamConnection.

Field Detail
CLOSED
final static int CLOSED(Code)
Indicates that a stream is closed.



OPEN
final static int OPEN(Code)
Indicates that a stream is opened.



READY
final static int READY(Code)
Indicates that a is ready to be opened.



inputStreamState
int inputStreamState(Code)
State of the input stream given out by getInputStream.



outputStreamState
int outputStreamState(Code)
State of the output stream given out by getOutputStream.




Constructor Detail
SSLStreamConnection
public SSLStreamConnection(String host, int port, InputStream in, OutputStream out, CertStore cs) throws IOException(Code)
Establish and SSL session over a reliable stream. This connection will forward the input and output stream close methods to the given connection. If the caller wants to have the given connection closed with this connection, the caller can close given connection after constructing this connection, but leaving the closing of the streams to this connection.
Parameters:
  host - hostname of the SSL server
Parameters:
  port - port number of the SSL server
Parameters:
  in - InputStream associated with the StreamConnection
Parameters:
  out - OutputStream associated with the StreamConnection
Parameters:
  cs - trusted certificate store to be used for this connection
exception:
  IOException - if there is a problem initializing the SSLdata structures or the SSL handshake fails




Method Detail
cleanupIfNeeded
void cleanupIfNeeded() throws IOException(Code)
Closes the SSL connection. The underlying TCP socket, over which SSL is layered, is also closed unless the latter was opened by an external application and its input/output streams were passed as argument to the SSLStreamConnection constructor.
exception:
  IOException - if the SSL connection could not beterminated cleanly



close
public synchronized void close() throws IOException(Code)
Closes the SSL connection. The underlying TCP socket, over which SSL is layered, is also closed unless the latter was opened by an external application and its input/output streams were passed as argument to the SSLStreamConnection constructor.
exception:
  IOException - if the SSL connection could not beterminated cleanly



getCipherSuite
String getCipherSuite()(Code)
Returns the cipher suite in use for the connection. The value returned is one of the CipherSuite definitions in Appendix C of RFC 2246. The cipher suite string should be used to represent the actual parameters used to establish the connection regardless of whether the secure connection uses SSL V3 or TLS 1.0 or WTLS. a String containing the cipher suite in use



getSecurityInfo
public SecurityInfo getSecurityInfo() throws IOException(Code)
Returns the security information associated with this connection. the security information associated with this open connection
exception:
  IOException - if the connection is closed



getServerCertificate
public X509Certificate getServerCertificate()(Code)
Returns the server certificate associated with this connection. the server certificate associated with this connection



openDataInputStream
public DataInputStream openDataInputStream() throws IOException(Code)
Returns the DataInputStream associated with this SSLStreamConnection.
exception:
  IOException - if the connection is not open or the stream was already open a DataInputStream object



openDataOutputStream
public DataOutputStream openDataOutputStream() throws IOException(Code)
Returns the DataOutputStream associated with this SSLStreamConnection.
exception:
  IOException - if the connection is not open or the stream was already open a DataOutputStream object



openInputStream
public synchronized InputStream openInputStream() throws IOException(Code)
Returns the InputStream associated with this SSLStreamConnection. InputStream object from which SSL protected bytes canbe read
exception:
  IOException - if the connection is not open or the stream was already open



openOutputStream
public synchronized OutputStream openOutputStream() throws IOException(Code)
Returns the OutputStream associated with this SSLStreamConnection. OutputStream object such that bytes written to this streamare sent over an SSL secured channel
exception:
  IOException - if the connection is not open or the stream was already open



Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.