Skip to content

Commit e68fa98

Browse files
committed
fix: api level from 3, docs for OpenSession*(Guid)
Change-Id: I2dfd10cfa86edc1363eff6e6fbcd3205e6287891
1 parent c9e3bd0 commit e68fa98

File tree

1 file changed

+40
-42
lines changed
  • src/Tizen.Security.TEEC/Tizen.Security.TEEC

1 file changed

+40
-42
lines changed

src/Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs

+40-42
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Tizen.Security.TEEC
2424
/// <summary>
2525
/// This type denotes Session Login Method used in OpenSession
2626
/// </summary>
27-
/// <since_tizen> 4 </since_tizen>
27+
/// <since_tizen> 3 </since_tizen>
2828
public class LoginMethod
2929
{
3030
/// <summary>No login data is provided.</summary>
@@ -40,7 +40,7 @@ public class LoginMethod
4040
/// <summary>
4141
/// This type denotes Value parameter
4242
/// </summary>
43-
/// <since_tizen> 4 </since_tizen>
43+
/// <since_tizen> 3 </since_tizen>
4444
public enum TEFValueType : UInt32
4545
{
4646
/// <summary>The Parameter is a ValueType tagged as input.</summary>
@@ -55,7 +55,7 @@ public enum TEFValueType : UInt32
5555
/// This type denotes TempMemoryReference parameter
5656
/// describing a region of memory which needs to be temporarily registered for the duration of the operation.
5757
/// </summary>
58-
/// <since_tizen> 4 </since_tizen>
58+
/// <since_tizen> 3 </since_tizen>
5959
public enum TEFTempMemoryType : UInt32
6060
{
6161
/// <summary>The Parameter is a TempMemoryType and is tagged as input.</summary>
@@ -69,7 +69,7 @@ public enum TEFTempMemoryType : UInt32
6969
/// <summary>
7070
/// This type denotes SharedMemoryReference parameter
7171
/// </summary>
72-
/// <since_tizen> 4 </since_tizen>
72+
/// <since_tizen> 3 </since_tizen>
7373
public enum TEFRegisteredMemoryType : UInt32
7474
{
7575
/// <summary>The Parameter is a Registered Memory Reference that refers to the entirety of its parent Shared Memory block.</summary>
@@ -85,7 +85,7 @@ public enum TEFRegisteredMemoryType : UInt32
8585
/// <summary>
8686
/// This type denotes SharedMemory access direction
8787
/// </summary>
88-
/// <since_tizen> 4 </since_tizen>
88+
/// <since_tizen> 3 </since_tizen>
8989
[Flags]
9090
public enum SharedMemoryFlags : UInt32
9191
{
@@ -101,7 +101,7 @@ public enum SharedMemoryFlags : UInt32
101101
/// This type denotes a Shared Memory block which has either been registered
102102
/// with the implementation or allocated by it.
103103
/// </summary>
104-
/// <since_tizen> 4 </since_tizen>
104+
/// <since_tizen> 3 </since_tizen>
105105
public sealed class SharedMemory
106106
{
107107
internal Interop.TEEC_SharedMemory shm;
@@ -112,15 +112,15 @@ internal SharedMemory(Interop.TEEC_SharedMemory shm)
112112
/// <summary>
113113
/// This property represents shared memory size in bytes.
114114
/// </summary>
115-
/// <since_tizen> 4 </since_tizen>
115+
/// <since_tizen> 3 </since_tizen>
116116
public UInt32 Size
117117
{
118118
get { return shm.size; }
119119
}
120120
/// <summary>
121121
/// This property represents start address of shared memory block.
122122
/// </summary>
123-
/// <since_tizen> 4 </since_tizen>
123+
/// <since_tizen> 3 </since_tizen>
124124
public IntPtr Address
125125
{
126126
get { return shm.buffer; }
@@ -130,7 +130,7 @@ public IntPtr Address
130130
/// This function makes a copy and is designed for convenient operations on small buffers.
131131
/// For large buffers direct address should be used.
132132
/// </summary>
133-
/// <since_tizen> 4 </since_tizen>
133+
/// <since_tizen> 3 </since_tizen>
134134
/// <param name="data">Source data buffer to copy data from</param>
135135
/// <param name="dstOffs">Starting offset in source shared memory</param>
136136
/// <exception cref="InvalidOperationException">The operation is invalid.</exception>
@@ -143,7 +143,7 @@ public void SetData(byte[] data, int dstOffs)
143143
/// This function makes a copy and is designed for convenient operations on small buffers.
144144
/// For large buffers direct address should be used.
145145
/// </summary>
146-
/// <since_tizen> 4 </since_tizen>
146+
/// <since_tizen> 3 </since_tizen>
147147
/// <param name="data">Destination data buffer to copy data into</param>
148148
/// <param name="dstOffs">Starting offset in destination shared memory</param>
149149
/// <exception cref="InvalidOperationException">The operation is invalid.</exception>
@@ -159,7 +159,7 @@ public void GetData(byte[] data, int srcOffs)
159159
/// also used for cancellation of operations, which may be desirable even if no payload is passed.
160160
/// Parameters are used to exchange data between CA and TA
161161
/// </summary>
162-
/// <since_tizen> 4 </since_tizen>
162+
/// <since_tizen> 3 </since_tizen>
163163
public abstract class Parameter
164164
{
165165
internal Parameter(uint t)
@@ -172,7 +172,7 @@ internal Parameter(uint t)
172172
/// <summary>
173173
/// This type defines a template for parameter types.
174174
/// </summary>
175-
/// <since_tizen> 4 </since_tizen>
175+
/// <since_tizen> 3 </since_tizen>
176176
public abstract class BaseParameter<TEnum> : Parameter where TEnum : struct, IComparable, IFormattable, IConvertible // as close to Enum as possible
177177
{
178178
internal BaseParameter(TEnum t) : base((uint)(object)t)
@@ -183,20 +183,20 @@ internal BaseParameter(TEnum t) : base((uint)(object)t)
183183
/// <summary>
184184
/// This property represents access type to this parameter.
185185
/// </summary>
186-
/// <since_tizen> 4 </since_tizen>
186+
/// <since_tizen> 3 </since_tizen>
187187
public TEnum Type { get; }
188188
}
189189

190190
/// <summary>
191191
/// This type defines a temporary memory reference.
192192
/// </summary>
193-
/// <since_tizen> 4 </since_tizen>
193+
/// <since_tizen> 3 </since_tizen>
194194
public sealed class TempMemoryReference : BaseParameter<TEFTempMemoryType>
195195
{
196196
/// <summary>
197197
/// Constructs Prameter object which holds info about temporary memory copied to/from TA
198198
/// </summary>
199-
/// <since_tizen> 4 </since_tizen>
199+
/// <since_tizen> 3 </since_tizen>
200200
/// <param name="buffer">Address of allocated memory buffer</param>
201201
/// <param name="size">Size of the buffer</param>
202202
/// <param name="type">Kind of access allowed for TA <see cref="TEFTempMemoryType"/></param>
@@ -209,25 +209,25 @@ public TempMemoryReference(IntPtr buffer, uint size, TEFTempMemoryType type) :
209209
/// <summary>
210210
/// This property represents memory address of buffer.
211211
/// </summary>
212-
/// <since_tizen> 4 </since_tizen>
212+
/// <since_tizen> 3 </since_tizen>
213213
public IntPtr Buffer { get; }
214214
/// <summary>
215215
/// This property represents size of buffer.
216216
/// </summary>
217-
/// <since_tizen> 4 </since_tizen>
217+
/// <since_tizen> 3 </since_tizen>
218218
public uint Size { get; }
219219
};
220220

221221
/// <summary>
222222
/// This type defines a memory reference that uses a pre-registered or pre-allocated Shared Memory block.
223223
/// </summary>
224-
/// <since_tizen> 4 </since_tizen>
224+
/// <since_tizen> 3 </since_tizen>
225225
public sealed class RegisteredMemoryReference : BaseParameter<TEFRegisteredMemoryType>
226226
{
227227
/// <summary>
228228
/// Constructs Prameter object which holds info about registered memory shared with TA
229229
/// </summary>
230-
/// <since_tizen> 4 </since_tizen>
230+
/// <since_tizen> 3 </since_tizen>
231231
/// <param name="parent">Shared memory - registered or allocated</param>
232232
/// <param name="size">Size of the buffer part</param>
233233
/// <param name="offset">Offset of buffer in shared memory</param>
@@ -242,31 +242,31 @@ public RegisteredMemoryReference(SharedMemory parent, uint size, uint offset, TE
242242
/// <summary>
243243
/// This property represents SharedMemory that is referred to.
244244
/// </summary>
245-
/// <since_tizen> 4 </since_tizen>
245+
/// <since_tizen> 3 </since_tizen>
246246
public SharedMemory Parent { get; }
247247
/// <summary>
248248
/// This property represents size (in bytes) of SharedMemory.
249249
/// </summary>
250-
/// <since_tizen> 4 </since_tizen>
250+
/// <since_tizen> 3 </since_tizen>
251251
public uint Size { get; }
252252
/// <summary>
253253
/// This property represents offset (in bytes) from the begin of SharedMemory.
254254
/// </summary>
255-
/// <since_tizen> 4 </since_tizen>
255+
/// <since_tizen> 3 </since_tizen>
256256
public uint Offset { get; }
257257
};
258258

259259
/// <summary>
260260
/// This type defines a parameter that is not referencing shared memory, but carries instead small raw data
261261
/// passed by value.
262262
/// </summary>
263-
/// <since_tizen> 4 </since_tizen>
263+
/// <since_tizen> 3 </since_tizen>
264264
public sealed class Value : BaseParameter<TEFValueType>
265265
{
266266
/// <summary>
267267
/// Constructs Prameter object which holds info about int values copied to/from TA
268268
/// </summary>
269-
/// <since_tizen> 4 </since_tizen>
269+
/// <since_tizen> 3 </since_tizen>
270270
/// <param name="a">User paramter A</param>
271271
/// <param name="b">User paramter B</param>
272272
/// <param name="type">Kind of access allowed for TA <see cref="TEFValueType"/></param>
@@ -279,20 +279,20 @@ public Value(uint a, uint b, TEFValueType type) :
279279
/// <summary>
280280
/// This property represents unsigned integer A.
281281
/// </summary>
282-
/// <since_tizen> 4 </since_tizen>
282+
/// <since_tizen> 3 </since_tizen>
283283
public uint A { get; }
284284
/// <summary>
285285
/// This property represents unsigned integer B.
286286
/// </summary>
287-
/// <since_tizen> 4 </since_tizen>
287+
/// <since_tizen> 3 </since_tizen>
288288
public uint B { get; }
289289
};
290290

291291

292292
/// <summary>
293293
/// This type denotes a TEE Session, the logical container linking a Client Application with a particular Trusted Application.
294294
/// </summary>
295-
/// <since_tizen> 4 </since_tizen>
295+
/// <since_tizen> 3 </since_tizen>
296296
public sealed class Session
297297
{
298298
private Interop.TEEC_Context context;
@@ -323,7 +323,7 @@ internal void Open(Guid destination, uint loginMethod, byte[] connectionData, Pa
323323
/// This function closes a Session which has been opened with a Trusted Application.
324324
/// All Commands within the Session MUST have completed before this function can be called.
325325
/// </summary>
326-
/// <since_tizen> 4 </since_tizen>
326+
/// <since_tizen> 3 </since_tizen>
327327
/// <privilege>http://tizen.org/privilege/tee.client</privilege>
328328
/// <privlevel>partner</privlevel>
329329
/// <feature>http://tizen.org/feature/security.tee</feature>
@@ -342,7 +342,7 @@ public void Close() {
342342
/// Trusted Application's protocol.
343343
/// There can be up to four Parameter objects given in the <paramref name="paramlist"/> array
344344
/// </summary>
345-
/// <since_tizen> 4 </since_tizen>
345+
/// <since_tizen> 3 </since_tizen>
346346
/// <param name="commandID">The command</param>
347347
/// <param name="paramlist">The array of parameters</param>
348348
/// <privilege>http://tizen.org/privilege/tee.client</privilege>
@@ -372,7 +372,7 @@ public void InvokeCommand(uint commandID, Parameter[] paramlist)
372372
/// <summary>
373373
/// Asynchronous version of InvokeCommand
374374
/// </summary>
375-
/// <since_tizen> 4 </since_tizen>
375+
/// <since_tizen> 3 </since_tizen>
376376
/// <param name="commandID">The command</param>
377377
/// <param name="paramlist">The array of parameters</param>
378378
/// <param name="token">The token for task manipulation</param>
@@ -394,7 +394,7 @@ public void InvokeCommand(uint commandID, Parameter[] paramlist)
394394
/// <summary>
395395
/// This type denotes a TEE Context, the main logical container linking a Client Application with a particular TEE.
396396
/// </summary>
397-
/// <since_tizen> 4 </since_tizen>
397+
/// <since_tizen> 3 </since_tizen>
398398
public sealed class Context : IDisposable
399399
{
400400
private Interop.TEEC_Context context;
@@ -403,7 +403,7 @@ public sealed class Context : IDisposable
403403
/// This function (constructor) initializes a new TEE Context, forming a connection between this Client Application and the
404404
/// TEE identified by the string identifier name (empty or null name denotes default TEE).
405405
/// </summary>
406-
/// <since_tizen> 4 </since_tizen>
406+
/// <since_tizen> 3 </since_tizen>
407407
/// <param name="name">The TEE name</param>
408408
/// <privilege>http://tizen.org/privilege/tee.client</privilege>
409409
/// <privlevel>partner</privlevel>
@@ -426,7 +426,7 @@ public Context(string name)
426426
/// <summary>
427427
/// This function implements IDisposable interface
428428
/// </summary>
429-
/// <since_tizen> 4 </since_tizen>
429+
/// <since_tizen> 3 </since_tizen>
430430
/// <privilege>http://tizen.org/privilege/tee.client</privilege>
431431
/// <privlevel>partner</privlevel>
432432
/// <feature>http://tizen.org/feature/security.tee</feature>
@@ -440,7 +440,7 @@ public void Dispose() {
440440
/// The target Trusted Application is identified by a UUID passed in the parameter destination.
441441
/// There can be up to four Parameter objects given in the {paramlist} array
442442
/// </summary>
443-
/// <since_tizen> 4 </since_tizen>
443+
/// <since_tizen> 3 </since_tizen>
444444
/// <param name="destination">The UUID of destination TA</param>
445445
/// <param name="loginMethod">The authentication algorithm <see cref="LoginMethod" /></param>
446446
/// <param name="connectionData">The data to be verified by given login method</param>
@@ -462,7 +462,7 @@ public Session OpenSession(Guid destination, uint loginMethod, byte[] connection
462462
/// <summary>
463463
/// @see OpenSession(Guid destination, uint connectionMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token)
464464
/// </summary>
465-
/// <since_tizen> 4 </since_tizen>
465+
/// <since_tizen> 3 </since_tizen>
466466
/// <param name="destination">The UUID of destination TA</param>
467467
/// <returns>Returns opened session</returns>
468468
/// <privilege>http://tizen.org/privilege/tee.client</privilege>
@@ -471,7 +471,6 @@ public Session OpenSession(Guid destination, uint loginMethod, byte[] connection
471471
/// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
472472
/// <exception cref="NotSupportedException">The required feature is not supported.</exception>
473473
/// <exception cref="InvalidOperationException">The operation is invalid.</exception>
474-
/// <exception cref="ArgumentException">The argument is wrong</exception>
475474
public Session OpenSession(Guid destination)
476475
{
477476
Session ses = new Session(context);
@@ -483,7 +482,7 @@ public Session OpenSession(Guid destination)
483482
/// Asynchronous version of OpenSession
484483
/// @see OpenSession(Guid destination, uint connectionMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token)
485484
/// </summary>
486-
/// <since_tizen> 4 </since_tizen>
485+
/// <since_tizen> 3 </since_tizen>
487486
/// <param name="destination">The UUID of destination TA</param>
488487
/// <param name="loginMethod">The authentication algorithm <see cref="LoginMethod" /></param>
489488
/// <param name="connectionData">The data to be verified by given login method</param>
@@ -509,7 +508,7 @@ public Session OpenSession(Guid destination)
509508
/// Asynchronous version of OpenSession
510509
/// @see OpenSession(Guid destination, uint connectionMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token)
511510
/// </summary>
512-
/// <since_tizen> 4 </since_tizen>
511+
/// <since_tizen> 3 </since_tizen>
513512
/// <param name="destination">The UUID of destination TA</param>
514513
/// <param name="token">The token for task manipulation</param>
515514
/// <returns>Returns Task executing session open in backgroung</returns>
@@ -519,7 +518,6 @@ public Session OpenSession(Guid destination)
519518
/// <exception cref="UnauthorizedAccessException">Thrown when application does not have privilege to access this method.</exception>
520519
/// <exception cref="NotSupportedException">The required feature is not supported.</exception>
521520
/// <exception cref="InvalidOperationException">The operation is invalid.</exception>
522-
/// <exception cref="ArgumentException">One of arguments is wrong</exception>
523521
public async Task<Session> OpenSessionAsync(Guid destination, CancellationToken token = default(CancellationToken))
524522
{
525523
Task<Session> task = Task<Session>.Factory.StartNew(() =>
@@ -534,7 +532,7 @@ public Session OpenSession(Guid destination)
534532
/// the scope of the specified Context, in accordance with the parameters.
535533
/// The input <paramref name="memaddr"/> MUST point to the shared memory region to register
536534
/// </summary>
537-
/// <since_tizen> 4 </since_tizen>
535+
/// <since_tizen> 3 </since_tizen>
538536
/// <param name="memaddr">The address of shared memory</param>
539537
/// <param name="size">The size of shared memory</param>
540538
/// <param name="flags">The flags describing access modes (Input and/or Output)</param>
@@ -561,7 +559,7 @@ public SharedMemory RegisterSharedMemory(IntPtr memaddr, UInt32 size, SharedMemo
561559
/// This function allocates a new block of memory as a block of Shared Memory within the scope of the
562560
/// specified Context, in accordance with the parameters.
563561
/// </summary>
564-
/// <since_tizen> 4 </since_tizen>
562+
/// <since_tizen> 3 </since_tizen>
565563
/// <param name="size">The size of shared memory</param>
566564
/// <param name="flags">The flags describing access modes (Input and/or Output)</param>
567565
/// <returns>Returns SharedMemory handler</returns>
@@ -591,7 +589,7 @@ public SharedMemory AllocateSharedMemory(UInt32 size, SharedMemoryFlags flags)
591589
/// underlying memory from the TEE, but the memory region will stay available to the Client Application for
592590
/// other purposes as the memory is owned by it.
593591
/// </summary>
594-
/// <since_tizen> 4 </since_tizen>
592+
/// <since_tizen> 3 </since_tizen>
595593
/// <param name="shm">The shared memory object returned by RegisterSharedMemory or AllocateSharedMemory</param>
596594
/// <privilege>http://tizen.org/privilege/tee.client</privilege>
597595
/// <privlevel>partner</privlevel>

0 commit comments

Comments
 (0)