Intel

Developer Zone

SessionApp

com.intel.security.dalinterface

Class SessionApp

  • java.lang.Object
    • com.intel.security.dalinterface.SessionApp


  • public final class SessionApp
    extends java.lang.Object
    class SessionApp implements Dal session, created for Trusted Applet and Session API-s
    • Method Summary

      Methods
      Modifier and Type Method and Description
      int closeSession()
      close existing Session
      long getSessionHandle()
      Retrieves Session identification handle
      java.lang.String getTrustedAppId()
      Retrieves Session Trusted Application Id
      boolean isOpened()
      Retrieves Session status
      boolean isShared()
      Retrieves isSharedSession property
      int openSession(byte[] init, int flags)
      Opens Session for Trusted Application enabling communication SessionApp#sendAndReceive()
      int registerEvents(EventsCallbackListener listener)
      Register callback for asynchronous event from Trusted Application to existing not shared session applicable for not shared session only
      int sendAndReceive(int command, TransactionData data)
      Synchronous API to provide command and data to Trusted Application and receive response
      int unregisterEvents()
      Unregister callback for asynchronous event from Trusted Application to existing session
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • openSession

        public final int openSession(byte[] init,
                      int flags)
        Opens Session for Trusted Application enabling communication SessionApp#sendAndReceive()
        Parameters:
        flags - - Session parameters, currently supported SESSION_SHARED_FLAG, SESSION_NO_FLAG
        init - - initial Session data, provided to Trusted Application (optional, can be null)
        Returns:
        transaction result or encoded exception, defined in DalConstants Class
      • closeSession

        public final int closeSession()
        close existing Session
        Returns:
        transaction result or encoded exception, defined in DalConstants Class
      • registerEvents

        public final int registerEvents(EventsCallbackListener listener)
        Register callback for asynchronous event from Trusted Application to existing not shared session applicable for not shared session only
        Parameters:
        listener - - EventsCallbackListener Class instance
        Returns:
        transaction result or encoded exception, defined in DalConstants Class
      • unregisterEvents

        public final int unregisterEvents()
        Unregister callback for asynchronous event from Trusted Application to existing session
        Returns:
        transaction result or encoded exception, defined in DalConstants Class
      • sendAndReceive

        public int sendAndReceive(int command,
                         TransactionData data)
        Synchronous API to provide command and data to Trusted Application and receive response
        Parameters:
        command - - Trusted Application specific command
        data - - TransactionData container on invocation: data.request should be set to the request buffer which is sent to the applet data.maxResponseLength should be set to the max expected response length, if (-1) is specified then data.maxResponseLength = request.length on return: data.response is set to the exact response buffer received from the applet data.appletResponseCode is set to the response code returned from the applet
        Returns:
        transaction result or encoded exception, defined in DalConstants Class
      • getTrustedAppId

        public final java.lang.String getTrustedAppId()
        Retrieves Session Trusted Application Id
        Returns:
        Trusted Application Id
      • isOpened

        public final boolean isOpened()
        Retrieves Session status
        Returns:
        true - opened Session exists; false - Session is not created / closed
      • isShared

        public final boolean isShared()
        Retrieves isSharedSession property
        Returns:
        true - shared session; false - not shared session;
      • getSessionHandle

        public final long getSessionHandle()
        Retrieves Session identification handle
        Returns:
        Session handle or -1 if session isn't opened;