Class Context
Definition
- Namespace:
- Tizen.Security.TEEC
- Assembly:
- Tizen.Security.TEEC.dll
- API Level:
- 3
This type denotes a TEE Context, the main logical container linking a Client Application with a particular TEE.
public sealed class Context : IDisposable
- Inheritance
-
Context
- Implements
Constructors
View SourceContext(String)
This function (constructor) initializes a new TEE Context, forming a connection between this client application and the TEE identified by the string identifier name (empty or null name denotes a default TEE).
Declaration
public Context(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The TEE name. |
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
NotSupportedException | The required feature is not supported. |
InvalidOperationException | The operation is invalid. |
API Level: 3
Privilege Level: partner
Privilege: http://tizen.org/privilege/tee.client
Feature: http://tizen.org/feature/security.tee
Methods
View SourceAllocateSharedMemory(UInt32, SharedMemoryFlags)
This function allocates a new block of memory as a block of shared memory within the scope of the specified context, in accordance with the parameters.
Declaration
public SharedMemory AllocateSharedMemory(uint size, SharedMemoryFlags flags)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | size | The size of shared memory. |
SharedMemoryFlags | flags | The flags describing access modes (Input and/or Output). |
Returns
Type | Description |
---|---|
SharedMemory | Returns the Shared Memory handler. |
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
NotSupportedException | The required feature is not supported. |
InvalidOperationException | The operation is invalid. |
API Level: 3
Privilege Level: partner
Privilege: http://tizen.org/privilege/tee.client
Feature: http://tizen.org/feature/security.tee
View SourceDispose()
This function implements the IDisposable interface.
Declaration
public void Dispose()
API Level: 3
Privilege Level: partner
Privilege: http://tizen.org/privilege/tee.client
Feature: http://tizen.org/feature/security.tee
View SourceFinalize()
Destructor of the class.
Declaration
protected void Finalize()
OpenSession(Guid)
@see OpenSession (Guid destination, uint connectionMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token).
Declaration
public Session OpenSession(Guid destination)
Parameters
Type | Name | Description |
---|---|---|
Guid | destination | The UUID of the destination TA. |
Returns
Type | Description |
---|---|
Session | Returns opened session. |
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
NotSupportedException | The required feature is not supported. |
InvalidOperationException | The operation is invalid. |
API Level: 3
Privilege Level: partner
Privilege: http://tizen.org/privilege/tee.client
Feature: http://tizen.org/feature/security.tee
View SourceOpenSession(Guid, UInt32, Byte[], Parameter[])
This function opens a new session between the client application and the specified trusted application.
The target trusted application is identified by an UUID passed in the parameter destination.
There can be up to four parameter objects given in the paramlist
array.
Declaration
public Session OpenSession(Guid destination, uint loginMethod, byte[] connectionData, Parameter[] paramlist)
Parameters
Type | Name | Description |
---|---|---|
Guid | destination | The UUID of the destination TA. |
UInt32 | loginMethod | The authentication algorithm LoginMethod. |
Byte[] | connectionData | The data to be verified by a given login method. |
Parameter[] | paramlist | The parameters to be passed to TA open-session-callback. |
Returns
Type | Description |
---|---|
Session | Returns opened session. |
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
NotSupportedException | The required feature is not supported. |
InvalidOperationException | The operation is invalid. |
ArgumentException | One of the arguments is wrong. |
API Level: 3
Privilege Level: partner
Privilege: http://tizen.org/privilege/tee.client
Feature: http://tizen.org/feature/security.tee
View SourceOpenSessionAsync(Guid, CancellationToken)
The asynchronous version of the OpenSession. @see OpenSession (Guid destination, uint connectionMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token).
Declaration
public Task<Session> OpenSessionAsync(Guid destination, CancellationToken token = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Guid | destination | The UUID of the destination TA. |
CancellationToken | token | The token for a task manipulation. |
Returns
Type | Description |
---|---|
Task<Session> | Returns a task executing session open in the background. |
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
NotSupportedException | The required feature is not supported. |
InvalidOperationException | The operation is invalid. |
API Level: 3
Privilege Level: partner
Privilege: http://tizen.org/privilege/tee.client
Feature: http://tizen.org/feature/security.tee
View SourceOpenSessionAsync(Guid, UInt32, Byte[], Parameter[], CancellationToken)
The asynchronous version of the OpenSession. @see OpenSession (Guid destination, uint connectionMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token).
Declaration
public Task<Session> OpenSessionAsync(Guid destination, uint loginMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Guid | destination | The UUID of the destination TA. |
UInt32 | loginMethod | The authentication algorithm LoginMethod. |
Byte[] | connectionData | The data to be verified by a given login method. |
Parameter[] | paramlist | The parameters to be passed to the TA open-session-callback. |
CancellationToken | token | The token for the task manipulation. |
Returns
Type | Description |
---|---|
Task<Session> | Returns a Task executing the session open in the background. |
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
NotSupportedException | The required feature is not supported. |
InvalidOperationException | The operation is invalid. |
ArgumentException | One of the arguments is wrong. |
API Level: 3
Privilege Level: partner
Privilege: http://tizen.org/privilege/tee.client
Feature: http://tizen.org/feature/security.tee
View SourceRegisterSharedMemory(IntPtr, UInt32, SharedMemoryFlags)
This function registers a block of the existing client application memory as a block of shared memory within
the scope of the specified context, in accordance with the parameters.
The input memaddr
must point to the shared memory region to register.
Declaration
public SharedMemory RegisterSharedMemory(IntPtr memaddr, uint size, SharedMemoryFlags flags)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | memaddr | The address of the shared memory. |
UInt32 | size | The size of the shared memory. |
SharedMemoryFlags | flags | The flags describing the access modes (Input and/or Output). |
Returns
Type | Description |
---|---|
SharedMemory | Returns the SharedMemory handler. |
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
NotSupportedException | The required feature is not supported. |
InvalidOperationException | The operation is invalid. |
ArgumentException | The argument |
API Level: 3
Privilege Level: partner
Privilege: http://tizen.org/privilege/tee.client
Feature: http://tizen.org/feature/security.tee
View SourceReleaseSharedMemory(SharedMemory)
This function deregisters or deallocates a previously initialized block of the shared memory.
Declaration
public void ReleaseSharedMemory(SharedMemory shm)
Parameters
Type | Name | Description |
---|---|---|
SharedMemory | shm | The shared memory object returned by RegisterSharedMemory or AllocateSharedMemory. |
Remarks
For a memory buffer allocated using AllocateSharedMemory, the implementation must free the underlying memory and the client application must not access this region after this function has been called. In this case, the implementation must clear the buffer and size fields of the shared memory structure before returning. For memory registered using RegisterSharedMemory, the implementation must deregister the underlying memory from the TEE, but the memory region will stay available to the client application for other purposes as the memory is owned by it.
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
NotSupportedException | The required feature is not supported. |
InvalidOperationException | The operation is invalid. |
ArgumentException | The argument is wrong. |