net.rim.device.api.crypto.tls.wtls20
Class WTLS20Connection

java.lang.Object
  extended by net.rim.device.api.crypto.tls.wtls20.WTLS20Connection
All Implemented Interfaces:
Connection, DatagramConnection

public class WTLS20Connection
extends Object
implements DatagramConnection

Represents a WTLS 2.0 Connection.

This class has two uses.

It can be used to instantiate a WTLS2.0 connection directly given an underlying connection (such as UDP) or it can be instantiated using Connector.open and specifying wtls as the protocol to use. It is important to note that during the wtls handshake we will handle any retransmits but once the handshake protocol has finished it is the responsibility of the HIGHER LAYER to retransmit any packets that were lost in the network.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

Field Summary
Category: Signed static int DELETE_SESSIONS_ON_ALERTS
          Whether to not delete sessions or not.
Category: Signed static int TIMEOUT
           
Category: Signed static int USE_CLIENT_ID_INFO
          Whether or not to use client id info.
Category: Signed static int WAP_20_CONFORMANCE
          Whether to use specific WAP 20 Conformance rules.
 
Constructor Summary
Category: Signed WTLS20Connection(DatagramConnection subConnection, String apn, String name)
          Creates an instance of the WTLS protocol passing in an underlying stream connection and the address you are connecting to.
Category: Signed WTLS20Connection(DatagramConnection subConnection, String apn, String name, int flags, int clientIdType, String clientIdValue)
          Creates an instance of the WTLS protocol passing in an underlying stream connection and the address you are connecting to.
Category: Signed WTLS20Connection(DatagramConnection subConnection, String apn, String name, int flags, int clientIdType, String clientIdValue, int ipAddress, int ipPort)
          Creates an instance of the WTLS protocol passing in an underlying stream connection and the address you are connecting to.
 
Method Summary
Category: Signed  void close()
          Close the connection.
Category: Signed  int getMaximumLength()
          Get the maximum length a datagram can be.
Category: Signed  int getNominalLength()
          Get the nominal length of a datagram.
Category: Signed  Datagram newDatagram(byte[] buf, int size)
          Make a new datagram object
Category: Signed  Datagram newDatagram(byte[] buf, int size, String addr)
          Make a new datagram object
Category: Signed  Datagram newDatagram(int size)
          Make a new datagram object automatically allocating a buffer
Category: Signed  Datagram newDatagram(int size, String addr)
          Make a new datagram object
Category: Signed  void receive(Datagram datagram)
          Receive a datagram
Category: Signed  void send(Datagram datagram)
          Send a datagram
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

USE_CLIENT_ID_INFO

public static final int USE_CLIENT_ID_INFO
Whether or not to use client id info.

See Also:
Constant Field Values
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

DELETE_SESSIONS_ON_ALERTS

public static final int DELETE_SESSIONS_ON_ALERTS
Whether to not delete sessions or not.

See Also:
Constant Field Values
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

WAP_20_CONFORMANCE

public static final int WAP_20_CONFORMANCE
Whether to use specific WAP 20 Conformance rules.

See Also:
Constant Field Values
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.0.0

TIMEOUT

public static final int TIMEOUT
See Also:
Constant Field Values
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0


Constructor Detail

WTLS20Connection

public WTLS20Connection(DatagramConnection subConnection,
                        String apn,
                        String name)
                 throws IOException,
                        TLSException
Creates an instance of the WTLS protocol passing in an underlying stream connection and the address you are connecting to. It is important to note that during the wtls handshake we will handle any retransmits but once the handshake protocol has finished it is the responsibility of the HIGHER LAYER to retransmit any packets that were lost in the network.

This creates the protocol and calls connect which will establish the connection with the server using TLS. To use the connection call the getInputStream and getOutputStream methods.

Parameters:
subConnection - An ordered stream connection such as a TCP connection which will provide the underlying transport for this protocol.
apn - The APN of the connection.
name - The address of the server and the port that were passed into the subConnection constructor.
Throws:
IOException - Thrown if an I/O error occurs. Also, an IOException can be thrown if the handheld is in FIPS mode which prevents the use of WTLS because it violates FIPS policy.
TLSException - Thrown if a TLS error occurs.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

WTLS20Connection

public WTLS20Connection(DatagramConnection subConnection,
                        String apn,
                        String name,
                        int flags,
                        int clientIdType,
                        String clientIdValue)
                 throws IOException,
                        TLSException
Creates an instance of the WTLS protocol passing in an underlying stream connection and the address you are connecting to. It is important to note that during the wtls handshake we will handle any retransmits but once the handshake protocol has finished it is the responsibility of the HIGHER LAYER to retransmit any packets that were lost in the network.

This creates the protocol and calls connect which will establish the connection with the server using TLS. To use the connection call the getInputStream and getOutputStream methods.

Parameters:
subConnection - An ordered stream connection such as a TCP connection which will provide the underlying transport for this protocol.
apn - The APN of the connection.
name - The address of the server and the port that were passed into the subConnection constructor.
flags - The flags of the type of session to be used.
Throws:
IOException - Thrown if an I/O error occurs. Also, an IOException can be thrown if the handheld is in FIPS mode which prevents the use of WTLS because it violates FIPS policy.
TLSException - Thrown if a TLS error occurs.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

WTLS20Connection

public WTLS20Connection(DatagramConnection subConnection,
                        String apn,
                        String name,
                        int flags,
                        int clientIdType,
                        String clientIdValue,
                        int ipAddress,
                        int ipPort)
                 throws IOException,
                        TLSException
Creates an instance of the WTLS protocol passing in an underlying stream connection and the address you are connecting to. It is important to note that during the wtls handshake we will handle any retransmits but once the handshake protocol has finished it is the responsibility of the HIGHER LAYER to retransmit any packets that were lost in the network.

This creates the protocol and calls connect which will establish the connection with the server using TLS. To use the connection call the getInputStream and getOutputStream methods.

Parameters:
subConnection - An ordered stream connection such as a TCP connection which will provide the underlying transport for this protocol.
apn - The APN of the connection.
name - The address of the server and the port that were passed into the subConnection constructor.
flags - The flags of the type of session to be used.
Throws:
IOException - Thrown if an I/O error occurs. Also, an IOException can be thrown if the handheld is in FIPS mode which prevents the use of WTLS because it violates FIPS policy.
TLSException - Thrown if a TLS error occurs.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.7.0


Method Detail

getMaximumLength

public int getMaximumLength()
                     throws IOException
Description copied from interface: DatagramConnection
Get the maximum length a datagram can be.

Specified by:
getMaximumLength in interface DatagramConnection
Returns:
The maximum length a datagram can be.
Throws:
IOException - If an I/O error occurs.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

getNominalLength

public int getNominalLength()
                     throws IOException
Description copied from interface: DatagramConnection
Get the nominal length of a datagram.

Specified by:
getNominalLength in interface DatagramConnection
Returns:
The nominal length a datagram can be.
Throws:
IOException - If an I/O error occurs.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

newDatagram

public Datagram newDatagram(byte[] buf,
                            int size)
                     throws IOException
Description copied from interface: DatagramConnection
Make a new datagram object

Specified by:
newDatagram in interface DatagramConnection
Parameters:
buf - The buffer to be used in the datagram
size - The length of the buffer to be allocated for the datagram
Returns:
A new datagram
Throws:
IOException - If an I/O error occurs.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

newDatagram

public Datagram newDatagram(byte[] buf,
                            int size,
                            String addr)
                     throws IOException
Description copied from interface: DatagramConnection
Make a new datagram object

Specified by:
newDatagram in interface DatagramConnection
Parameters:
buf - The buffer to be used in the datagram
size - The length of the buffer to be used
addr - The I/O address to which the datagram will be sent
Returns:
A new datagram
Throws:
IOException - If an I/O error occurs.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

newDatagram

public Datagram newDatagram(int size)
                     throws IOException
Description copied from interface: DatagramConnection
Make a new datagram object automatically allocating a buffer

Specified by:
newDatagram in interface DatagramConnection
Parameters:
size - The length of the buffer to be allocated for the datagram
Returns:
A new datagram
Throws:
IOException - If an I/O error occurs.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

newDatagram

public Datagram newDatagram(int size,
                            String addr)
                     throws IOException
Description copied from interface: DatagramConnection
Make a new datagram object

Specified by:
newDatagram in interface DatagramConnection
Parameters:
size - The length of the buffer to be used
addr - The I/O address to which the datagram will be sent
Returns:
A new datagram
Throws:
IOException - If an I/O error occurs.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

receive

public void receive(Datagram datagram)
             throws IOException
Description copied from interface: DatagramConnection
Receive a datagram

Specified by:
receive in interface DatagramConnection
Parameters:
datagram - A datagram.
Throws:
IOException - If an I/O error occurs.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

send

public void send(Datagram datagram)
          throws IOException
Description copied from interface: DatagramConnection
Send a datagram

Specified by:
send in interface DatagramConnection
Parameters:
datagram - A datagram.
Throws:
IOException - If an I/O error occurs.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0

close

public void close()
           throws IOException
Description copied from interface: Connection
Close the connection.

When a connection has been closed, access to any of its methods except this close() will cause an an IOException to be thrown. Closing an already closed connection has no effect. Streams derived from the connection may be open when method is called. Any open streams will cause the connection to be held open until they themselves are closed. In this latter case access to the open streams is permitted, but access to the connection is not.

BlackBerry Implementation Note: When developing applications for the BlackBerry Wireless handheld, note that the stream must be flushed or closed before the program exits, otherwise all pending data will be lost.

Specified by:
close in interface Connection
Throws:
IOException - If an I/O error occurs
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 3.6.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal