Package uicc.connection
Interface SCP8XConnection
- All Superinterfaces:
Observable
The
SCP8XConnection interface represents an SCP81 or SCP82 connection to
a remote entity.
Objects implementing SCP8XConnectioninterface and returned by the
ConnectionServer.getConnection method are Permanent Entry Point Objects.-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the SCP81 or SCP82 Connection.voidopen(byte[] triggeringParameters, short parameterOffset, short parameterLength, byte[] contentType, short contentTypeOffset, short contentTypeLength) Request to open the SCP81 or SCP82 connection.voidsend(byte[] baData, short sOffset, short sLength) Sends data on the SCP81 or SCP82 Connection.
-
Method Details
-
open
void open(byte[] triggeringParameters, short parameterOffset, short parameterLength, byte[] contentType, short contentTypeOffset, short contentTypeLength) throws ConnectionException Request to open the SCP81 or SCP82 connection.The associated (directly or indirectly) Security Domain of the calling application will handle the PSK TLS or DTLS security of the communication.
The calling application will be notified once the connection is opened or once the setup failed. This method is non-blocking. Note:
- On invocation of this method, the Security Domain shall register this request.
Once resources are available, the RTE/OPEN tries to open the connection, manage
the underlying protocol layers and performs the TLS or DTLS handshake. The observer is then notified with
the
SCP8XConnectionStatusevent.
- Parameters:
triggeringParameters- this buffer contains the administration session triggering parameters as defined in table 3-3 of Amendment B [5] of Global Platform Card Specification version 2.3, with the appropriate adaptations described in Table 3-6 of Amendment M [8] for the SCP82 case Tag '81' and Length shall be present. Connection parameters defined in Tag '84' may be used if TCP or UDP transport is provided by the Bearer Independent Protocol of TS 102 223 [4]. Note: If a direct IP connection as specified in TS 102 483 [6] is used these parameters will be ignored.parameterOffset- the starting offset of the parameters in thetriggeringParametersbyte arrayparameterLength- the length of the parameterscontentType- this buffer contains the Content-Type header value to be used when sending an HTTP or CoAP POST request through this connection.contentTypeOffset- the starting offset of the content-type in thecontentTypebyte arraycontentTypeLength- the length of the content-type- Throws:
ConnectionException- with the following reason code:INVALID_STATEif the connection is already opened.INVALID_PARAMETERSif the triggering parameters are not correct or if the Content-Type header value defined in the parameters is reserved (for example for RAM/RFM over HTTP or CoAP or for SCWS remote administration).SCP81_KEY_NOT_FOUNDif this requested SCP81 key could no be found in the associated (directly or indirectly) Security Domain of the calling application.SCP82_KEY_NOT_FOUNDif this requested SCP82 key could no be found in the associated (directly or indirectly) Security Domain of the calling application.INVALID_HEADER_FIELDif Content-Type header field does not conform with the rules defined in this specification.TOOLKIT_RESOURCE_NOT_AVAILABLEif the proactive command could not be issued.
ArrayIndexOutOfBoundsException- ifparameterOffsetandparameterLengthare causing access outside oftriggeringParametersarray bounds or ifcontentTypeOffsetandcontentTypeLengthare causing access outside ofcontentTypearray bounds.NullPointerException- iftriggeringParametersorcontentTypeare equal tonull
- On invocation of this method, the Security Domain shall register this request.
Once resources are available, the RTE/OPEN tries to open the connection, manage
the underlying protocol layers and performs the TLS or DTLS handshake. The observer is then notified with
the
-
close
Close the SCP81 or SCP82 Connection. The calling application will be notified once the connection is closed. This method is non-blocking.- Throws:
ConnectionException- with the following reason code:INVALID_STATEif the connection is not open.TOOLKIT_RESOURCE_NOT_AVAILABLEif the proactive command could not be issued.
-
send
void send(byte[] baData, short sOffset, short sLength) throws ArrayIndexOutOfBoundsException, ConnectionException, NullPointerException Sends data on the SCP81 or SCP82 Connection.Note: The applet execution is resumed once the HTTP POST request or CoAP POST request containing the data has been sent.
Note: The chunked transfer coding may be used if necessary.
- Parameters:
baData- byte array containing the data to be sentsOffset- the starting offset of the data to be sent in thebaDatabyte arraysLength- the length of the data to be sent- Throws:
ArrayIndexOutOfBoundsException- ifsOffsetandsLengthare causing access outside ofbaDataarray boundsConnectionException- with the following reason code:INVALID_STATEif- the connection is not open
- or if data has been sent through the HTTP POST request and the related HTTP POST response has not yet been delivered to the applet with the DataReceived event
- or if an HTTP POST response has been delivered to the applet but all received data have not been received or discarded.
- or if data has been sent through the CoAP request and the related CoAP response has not yet been delivered to the applet with the DataReceived event
- or if an CoAP response has been delivered to the applet but all received data have not been received or discarded.
TOOLKIT_RESOURCE_NOT_AVAILABLEif the proactive command could not be issued.
NullPointerException- ifbaDatais equal tonull
-