Release 4.0.0-preview1-00285
[platform/core/csapi/tizenfx.git] / src / Tizen.Security.TEEC / doc / api / Tizen.Security.TEEC.md
1 ---
2 uid: Tizen.Security.TEEC
3 summary: The communication API for connecting Client Applications running in a rich operating environment
4   with security related Trusted Applications running inside a Trusted Execution Environment (TEE).
5 remarks: *content
6 ---
7 ## Overview
8 A TEE provides an execution environment with security capabilities, which are either available to Trusted Applications
9 running inside the TEE or exposed externally to Client Applications.
10 The TEE Client API concentrates on the interface to enable efficient communications between
11 a Client Application and a Trusted Application running inside the TEE.
12 Higher level standards and protocol layers may be built on top of the foundation
13 provided by the TEE Client API – for example, to cover common tasks, such as secure storage,
14 cryptography, and run-time installation of new Trusted Applications.
15 The separation between the rich environment and the TEE is guaranted.
16
17 The key design principles of the TEE Client API are:
18   * Client-side memory allocations
19         Where possible the design of the TEE Client API has placed the responsibility for memory
20         allocation on the calling Client Application code. This gives the Client developer choice of
21         memory allocation locations, enabling simple optimizations, such as stack-based allocation
22         or enhanced flexibility using placements in static global memory or thread-local storage.
23
24         This design choice is evident in the API by the use of pointers to structures rather than
25         opaque handles to represent any manipulated objects.
26   * Aim for zero-copy data transfer
27         The features of the TEE Client API are chosen to maximize the possibility of zero-copy
28         data transfer between the Client Application and the Trusted Application.
29         However, short messages can also be passed by copy, which avoids the overhead of
30         sharing memory.
31   * Support memory sharing by pointers
32         The TEE Client API will be used to implement higher-level APIs, such as cryptography or
33         secure storage, where the caller will often provide memory buffers for input or output data
34         using simple C pointers. The TEE Client API must allow efficient sharing of this type of
35         memory, and as such does not rely on the Client Application being able to use bulk
36         memory buffers allocated by the TEE Client API.
37   * Specify only communication mechanisms
38         This API focuses on defining the underlying communications channel. It does not define
39         the format of the messages which pass over the channel, or the protocols used by specific
40         Trusted Applications.
41
42 ## Example
43 The following example demonstrates how to invoke command on Trused Application.
44
45 ```cs
46 Guid ta_uuid = new Guid("TA-guid-put-here");
47 Context ctx = new Context(null);
48 Session ses = ctx.OpenSession(ta_uuid);
49 Parameter[] p = { new Value(1,2,TEFValueType.In) };
50 ses.InvokeCommand(1, p);
51 ses.Close();
52 ctx.Dispose();
53 ```