From 117467669d7e968f894d97fe93bb718899c5b8b8 Mon Sep 17 00:00:00 2001 From: Editor Lionbridge Date: Tue, 22 Aug 2017 16:39:03 +0530 Subject: [PATCH] Review libteec API cs files Change-Id: I96facbc64e506677ab2738a8ebdff1d5c3080597 --- Tizen.Security.TEEC/Interop/Interop.Libteec.cs | 84 +++---- Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs | 274 ++++++++++----------- .../Tizen.Security.TEEC/NamespaceDoc.cs | 4 +- 3 files changed, 181 insertions(+), 181 deletions(-) diff --git a/Tizen.Security.TEEC/Interop/Interop.Libteec.cs b/Tizen.Security.TEEC/Interop/Interop.Libteec.cs index 1c1f969..9680956 100644 --- a/Tizen.Security.TEEC/Interop/Interop.Libteec.cs +++ b/Tizen.Security.TEEC/Interop/Interop.Libteec.cs @@ -23,9 +23,9 @@ internal static partial class Interop internal static partial class Libteec { /// - /// This function initializes a new TEE Context, forming a connection between this Client Application and the + /// This function initializes a new TEE Context, forming a connection between this client application and the /// TEE identified by the string identifier name. - /// The Client Application MAY pass name with a value of NULL, which means that the Implementation MUST + /// The client application may pass a name with a value of null, which means that the implementation must /// select a default TEE to connect to. The supported name strings, the mapping of these names to a specific /// TEE, and the nature of the default TEE are implementation-defined. /// @@ -34,94 +34,94 @@ internal static partial class Interop static public extern int InitializeContext(string name, ref TEEC_Context context); /// - /// This function destroys an initialized TEE Context, closing the connection between the Client Application - /// and the TEE. The Client Application MUST only call this function when all Sessions inside this TEE - /// Context have been closed and all Shared Memory blocks have been released. - /// The implementation of this function MUST NOT be able to fail; after this function returns the Client - /// Application must be able to consider that the Context has been closed. - /// The function implementation MUST do nothing if the value of the context pointer is NULL. + /// This function destroys an initialized TEE Context, closing the connection between the client application + /// and the TEE. The client application must only call this function when all sessions inside this TEE + /// context have been closed and all shared memory blocks have been released. + /// The implementation of this function must not fail; after this function returns, the client + /// application must be able to consider that the context has been closed. + /// The function implementation must do nothing if the value of the context pointer is null. /// //void TEEC_FinalizeContext(TEEC_Context *context); [DllImport(Libraries.Libteec, EntryPoint = "TEEC_FinalizeContext", CallingConvention = CallingConvention.Cdecl)] static public extern void FinalizeContext(ref TEEC_Context context); /// - /// This function registers a block of existing Client Application memory as a block of Shared Memory within + /// This function registers a block of existing client application memory as a block of shared memory within /// the scope of the specified TEE Context, in accordance with the parameters which have been set by the - /// Client Application inside the sharedMem structure. - /// The input context MUST point to an initialized TEE Context. - /// The input sharedMem MUST point to the Shared Memory structure defining the memory region to register + /// client application inside the shared memory structure. + /// The input context must point to an initialized TEE Context. + /// The input shared Memory must point to the shared memory structure defining the memory region to register. /// //EEC_Result TEEC_RegisterSharedMemory(TEEC_Context *context, TEEC_SharedMemory *sharedMem); [DllImport(Libraries.Libteec, EntryPoint = "TEEC_RegisterSharedMemory", CallingConvention = CallingConvention.Cdecl)] static public extern int RegisterSharedMemory(ref TEEC_Context context, ref TEEC_SharedMemory sharedMem); /// - /// This function allocates a new block of memory as a block of Shared Memory within the scope of the - /// specified TEE Context, in accordance with the parameters which have been set by the Client Application - /// inside the sharedMem structure. - /// The input context MUST point to an initialized TEE Context. - /// The input sharedMem MUST point to the Shared Memory structure defining the region to allocate. + /// This function allocates a new block of memory as a block of shared memory within the scope of the + /// specified TEE Context, in accordance with the parameters which have been set by the client application + /// inside the shared memory structure. + /// The input context must point to an initialized TEE Context. + /// The input shared memory must point to the shared memory structure defining the region to allocate. /// //TEEC_Result TEEC_AllocateSharedMemory(TEEC_Context *context, TEEC_SharedMemory *sharedMem); [DllImport(Libraries.Libteec, EntryPoint = "TEEC_AllocateSharedMemory", CallingConvention = CallingConvention.Cdecl)] static public extern int AllocateSharedMemory(ref TEEC_Context context, ref TEEC_SharedMemory sharedMem); /// - /// This function deregisters or deallocates a previously initialized block of Shared Memory. - /// 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 set the buffer and size fields of the sharedMem - /// structure to NULL and 0 respectively 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 + /// This function deregisters or deallocates a previously initialized block of the shared memory. + /// 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 set the buffer and size fields of the shared memory + /// structure to null and 0 respectively 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. - /// The implementation MUST do nothing if the value of the sharedMem parameter is NULL. + /// The implementation must do nothing if the value of the shared memory parameter is null. /// //void TEEC_ReleaseSharedMemory(TEEC_SharedMemory *sharedMem); [DllImport(Libraries.Libteec, EntryPoint = "TEEC_ReleaseSharedMemory", CallingConvention = CallingConvention.Cdecl)] static public extern void ReleaseSharedMemory(ref TEEC_SharedMemory sharedMem); /// - /// This function opens a new Session between the Client Application and the specified Trusted Application. - /// The Implementation MUST assume that all fields of this session structure are in an undefined state. - /// When this function returns TEEC_SUCCESS the Implementation MUST have populated this structure with - /// any information necessary for subsequent operations within the Session. - /// The target Trusted Application is identified by a UUID passed in the parameter destination. + /// This function opens a new session between the client application and the specified trusted application. + /// The implementation must assume that all fields of this session structure are in an undefined state. + /// When this function returns TEEC_SUCCESS, the implementation must have populated this structure with + /// any information necessary for subsequent operations within the session. + /// The target trusted application is identified by the UUID passed in the parameter destination. /// //TEEC_Result TEEC_OpenSession(TEEC_Context *context, TEEC_Session *session, const TEEC_UUID *destination, uint connectionMethod, const void *connectionData, TEEC_Operation *operation, uint *returnOrigin); [DllImport(Libraries.Libteec, EntryPoint = "TEEC_OpenSession", CallingConvention = CallingConvention.Cdecl)] static public extern int OpenSession(ref TEEC_Context context, ref TEEC_Session session, TEEC_UUID destination, uint connectionMethod, byte[] connectionData, ref TEEC_Operation operation, out uint returnOrigin); /// - /// This function closes a Session which has been opened with a Trusted Application. - /// All Commands within the Session MUST have completed before this function can be called. - /// The Implementation MUST do nothing if the input session parameter is NULL. - /// The implementation of this function MUST NOT be able to fail; after this function returns the Client - /// Application must be able to consider that the Session has been closed. + /// This function closes a session which has been opened with a trusted application. + /// All commands within the session must have completed before this function can be called. + /// The implementation must do nothing if the input session parameter is null. + /// The implementation of this function must not fail; after this function returns, the Client + /// Application must be able to consider that the session has been closed. /// //void TEEC_CloseSession(TEEC_Session *session); [DllImport(Libraries.Libteec, EntryPoint = "TEEC_CloseSession", CallingConvention = CallingConvention.Cdecl)] static public extern void CloseSession(ref TEEC_Session session); /// - /// This function invokes a Command within the specified Session. - /// The parameter session MUST point to a valid open Session. + /// This function invokes a command within the specified session. + /// The parameter session must point to a valid open session. /// The parameter commandID is an identifier that is used to indicate which of the exposed Trusted /// Application functions should be invoked. The supported command identifier values are defined by the - /// Trusted Application‟s protocol. + /// trusted application's protocol. /// //TEEC_Result TEEC_InvokeCommand(TEEC_Session *session, uint commandID, TEEC_Operation *operation, uint *returnOrigin); [DllImport(Libraries.Libteec, EntryPoint = "TEEC_InvokeCommand", CallingConvention = CallingConvention.Cdecl)] static public extern int InvokeCommand(ref TEEC_Session session, uint commandID, ref TEEC_Operation operation, out uint returnOrigin); /// - /// This function requests the cancellation of a pending open Session operation or a Command invocation + /// This function requests the cancelation of a pending open session operation or a command invocation /// operation. As this is a synchronous API, this function must be called from a thread other than the one /// executing the OpenSession or InvokeCommand function. - /// This function just sends a cancellation signal to the TEE and returns immediately; the operation is not - /// guaranteed to have been cancelled when this function returns. In addition, the cancellation request is just - /// a hint; the TEE or the Trusted Application MAY ignore the cancellation request. + /// This function just sends a cancelation signal to the TEE and returns immediately; the operation is not + /// guaranteed to have been canceled when this function returns. In addition, the cancelation request is just + /// a hint; the TEE or the trusted application may ignore the cancelation request. /// //void TEEC_RequestCancellation(TEEC_Operation *operation); [DllImport(Libraries.Libteec, EntryPoint = "TEEC_RequestCancellation", CallingConvention = CallingConvention.Cdecl)] diff --git a/Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs b/Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs index 5393400..f05cb74 100644 --- a/Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs +++ b/Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs @@ -22,83 +22,83 @@ using System.Threading.Tasks; namespace Tizen.Security.TEEC { /// - /// This type denotes Session Login Method used in OpenSession + /// This type denotes the Session Login Method used in OpenSession. /// /// 3 public class LoginMethod { /// No login data is provided. public const uint Public = 0x00000000; - /// Login data about the user running the Client Application process is provided. + /// Login data about the user running the client application process is provided. public const uint User = 0x00000001; - /// Login data about the group running the Client Application process is provided. + /// Login data about the group running the client application process is provided. public const uint Group = 0x00000002; - /// Login data about the running Client Application itself is provided. + /// Login data about the running client application itself is provided. public const uint Application = 0x00000003; } /// - /// This type denotes Value parameter + /// This type denotes the Value parameter. /// /// 3 public enum TEFValueType : UInt32 { - /// The Parameter is a ValueType tagged as input. + /// The parameter is a ValueType tagged as the input. Input = 0x00000001, - /// The Parameter is a ValueType tagged as output. + /// The parameter is a ValueType tagged as the output. Output = 0x00000002, - /// The Parameter is a ValueType tagged as both as input and output. + /// The parameter is a ValueType tagged as both the input and the output. InOut = 0x00000003, } /// - /// This type denotes TempMemoryReference parameter + /// This type denotes the TempMemoryReference parameter /// describing a region of memory which needs to be temporarily registered for the duration of the operation. /// /// 3 public enum TEFTempMemoryType : UInt32 { - /// The Parameter is a TempMemoryType and is tagged as input. + /// The parameter is a TempMemoryType and is tagged as the input. Input = 0x00000005, - /// Same as Input, but the Memory Reference is tagged as output. + /// Same as the input, but the Memory Reference is tagged as the output. Output = 0x00000006, - /// A Temporary Memory Reference tagged as both input and output. + /// A Temporary Memory Reference tagged as both the input and the output. InOut = 0x00000007, } /// - /// This type denotes SharedMemoryReference parameter + /// This type denotes the SharedMemoryReference parameter. /// /// 3 public enum TEFRegisteredMemoryType : UInt32 { - /// The Parameter is a Registered Memory Reference that refers to the entirety of its parent Shared Memory block. + /// The parameter is a registered memory reference that refers to the entirety of its parent shared memory block. Whole = 0x0000000C, - /// A Registered Memory Reference structure that refers to a partial region of its parent Shared Memory block and is tagged as input. + /// A registered memory reference structure that refers to a partial region of its parent shared mMemory block and is tagged as the input. PartialInput = 0x0000000D, - /// A Registered Memory Reference structure that refers to a partial region of its parent Shared Memory block and is tagged as output. + /// A registered memory reference structure that refers to a partial region of its parent shared memory block and is tagged as the output. PartialOutput = 0x0000000E, - /// A Registered Memory Reference structure that refers to a partial region of its parent Shared Memory block and is tagged as both input and output. + /// A registered memory reference structure that refers to a partial region of its parent shared memory block and is tagged as both the input and the output. PartialInOut = 0x0000000F, } /// - /// This type denotes SharedMemory access direction + /// This type denotes the SharedMemory access direction. /// /// 3 [Flags] public enum SharedMemoryFlags : UInt32 { - /// A flag indicates Shared Memory can be read. + /// A flag indicates the shared memory can be read. Input = 0x00000001, - /// A flag indicates Shared Memory can be written. + /// A flag indicates the shared memory can be written. Output = 0x00000002, - /// A flag indicates Shared Memory can be read and written. + /// A flag indicates the shared memory can be read and written. InOut = Input | Output, } /// - /// This type denotes a Shared Memory block which has either been registered + /// This type denotes a shared memory block which has been either registered /// with the implementation or allocated by it. /// /// 3 @@ -110,7 +110,7 @@ namespace Tizen.Security.TEEC this.shm=shm; } /// - /// This property represents shared memory size in bytes. + /// This property represents the shared memory size in bytes. /// /// 3 public UInt32 Size @@ -118,7 +118,7 @@ namespace Tizen.Security.TEEC get { return shm.size; } } /// - /// This property represents start address of shared memory block. + /// This property represents the start address of the shared memory block. /// /// 3 public IntPtr Address @@ -128,11 +128,11 @@ namespace Tizen.Security.TEEC /// /// This function makes a copy and is designed for convenient operations on small buffers. - /// For large buffers direct address should be used. + /// For large buffers, the direct address should be used. /// /// 3 - /// Source data buffer to copy data from - /// Starting offset in destination shared memory + /// The source data buffer to copy data from. + /// The starting offset in the destination shared memory. /// The operation is invalid. public void SetData(byte[] data, int dstOffs) { @@ -141,11 +141,11 @@ namespace Tizen.Security.TEEC } /// /// This function makes a copy and is designed for convenient operations on small buffers. - /// For large buffers direct address should be used. + /// For large buffers, the direct address should be used. /// /// 3 - /// Destination data buffer to copy data into - /// Starting offset in source shared memory + /// The destination data buffer to copy data into. + /// The starting offset in the source shared memory. /// The operation is invalid. public void GetData(byte[] data, int srcOffs) { @@ -155,9 +155,9 @@ namespace Tizen.Security.TEEC }; /// - /// This type defines the payload of either an open Session operation or an invoke Command operation. It is - /// also used for cancellation of operations, which may be desirable even if no payload is passed. - /// Parameters are used to exchange data between CA and TA + /// This type defines the payload of either an open session operation or an invoke command operation. It is + /// also used for cancelation of operations, which may be desirable even if no payload is passed. + /// Parameters are used to exchange data between CA and TA. /// /// 3 public abstract class Parameter @@ -170,7 +170,7 @@ namespace Tizen.Security.TEEC }; /// - /// This type defines a template for parameter types. + /// This type defines a template for the parameter types. /// /// 3 public abstract class BaseParameter : Parameter where TEnum : struct, IComparable, IFormattable, IConvertible // as close to Enum as possible @@ -181,7 +181,7 @@ namespace Tizen.Security.TEEC } /// - /// This property represents access type to this parameter. + /// This property represents the access type to this parameter. /// /// 3 public TEnum Type { get; } @@ -194,12 +194,12 @@ namespace Tizen.Security.TEEC public sealed class TempMemoryReference : BaseParameter { /// - /// Constructs Prameter object which holds info about temporary memory copied to/from TA + /// Constructs a parameter object which holds information about the temporary memory copied to or from TA. /// /// 3 - /// Address of allocated memory buffer - /// Size of the buffer - /// Kind of access allowed for TA + /// The address of the allocated memory buffer. + /// The size of the buffer. + /// The kind of access allowed for TA . public TempMemoryReference(IntPtr buffer, uint size, TEFTempMemoryType type) : base(type) { @@ -207,31 +207,31 @@ namespace Tizen.Security.TEEC this.Size = size; } /// - /// This property represents memory address of buffer. + /// This property represents the memory address of the buffer. /// /// 3 public IntPtr Buffer { get; } /// - /// This property represents size of buffer. + /// This property represents the size of the buffer. /// /// 3 public uint Size { get; } }; /// - /// This type defines a memory reference that uses a pre-registered or pre-allocated Shared Memory block. + /// This type defines a memory reference that uses a pre-registered or pre-allocated shared memory block. /// /// 3 public sealed class RegisteredMemoryReference : BaseParameter { /// - /// Constructs Prameter object which holds info about registered memory shared with TA + /// Constructs a parameter object which holds information about the registered memory shared with TA. /// /// 3 - /// Shared memory - registered or allocated - /// Size of the buffer part - /// Offset of buffer in shared memory - /// Kind of access allowed for TA + /// The shared memory - registered or allocated. + /// The size of the buffer part. + /// The offset of the buffer in the shared memory. + /// The kind of access allowed for TA . public RegisteredMemoryReference(SharedMemory parent, uint size, uint offset, TEFRegisteredMemoryType type) : base(type) { @@ -240,36 +240,36 @@ namespace Tizen.Security.TEEC this.Offset = offset; } /// - /// This property represents SharedMemory that is referred to. + /// This property represents the shared memory that is referred to. /// /// 3 public SharedMemory Parent { get; } /// - /// This property represents size (in bytes) of SharedMemory. + /// This property represents the size (in bytes) of the shared memory. /// /// 3 public uint Size { get; } /// - /// This property represents offset (in bytes) from the begin of SharedMemory. + /// This property represents the offset (in bytes) from the start of the shared memory. /// /// 3 public uint Offset { get; } }; /// - /// This type defines a parameter that is not referencing shared memory, but carries instead small raw data - /// passed by value. + /// This type defines a parameter that is not referencing the shared memory, but carries instead small raw data + /// passed by a value. /// /// 3 public sealed class Value : BaseParameter { /// - /// Constructs Prameter object which holds info about int values copied to/from TA + /// Constructs a parameter object which holds information about integer values copied to or from TA. /// /// 3 - /// User paramter A - /// User paramter B - /// Kind of access allowed for TA + /// User paramter A. + /// User paramter B. + /// The kind of access allowed for TA . public Value(uint a, uint b, TEFValueType type) : base(type) { @@ -277,12 +277,12 @@ namespace Tizen.Security.TEEC this.B = b; } /// - /// This property represents unsigned integer A. + /// This property represents an unsigned integer A. /// /// 3 public uint A { get; } /// - /// This property represents unsigned integer B. + /// This property represents an unsigned integer B. /// /// 3 public uint B { get; } @@ -290,7 +290,7 @@ namespace Tizen.Security.TEEC /// - /// This type denotes a TEE Session, the logical container linking a Client Application with a particular Trusted Application. + /// This type denotes a TEE Session, the logical container linking a client application with a particular trusted application. /// /// 3 public sealed class Session @@ -320,14 +320,14 @@ namespace Tizen.Security.TEEC } /// - /// This function closes a Session which has been opened with a Trusted Application. - /// All Commands within the Session MUST have completed before this function can be called. + /// This function closes a session which has been opened with a trusted application. + /// All commands within the session must be completed before this function can be called. /// /// 3 /// http://tizen.org/privilege/tee.client /// partner /// http://tizen.org/feature/security.tee - /// Thrown when application does not have privilege to access this method. + /// Thrown when an application does not have the privilege to access this method. /// The required feature is not supported. /// The operation is invalid. public void Close() { @@ -336,22 +336,22 @@ namespace Tizen.Security.TEEC } /// - /// This function invokes a Command within the specified Session. - /// The parameter commandID is an identifier that is used to indicate which of the exposed Trusted - /// Application functions should be invoked. The supported command identifier values are defined by the - /// Trusted Application's protocol. - /// There can be up to four Parameter objects given in the array + /// This function invokes a command within the specified session. + /// The parameter commandID is an identifier that is used to indicate which of the exposed trusted + /// application functions should be invoked. The supported command identifier values are defined by the + /// trusted application's protocol. + /// There can be up to four parameter objects given in the array. /// /// 3 - /// The command - /// The array of parameters + /// The command. + /// The array of parameters. /// http://tizen.org/privilege/tee.client /// partner /// http://tizen.org/feature/security.tee - /// Thrown when application does not have privilege to access this method. + /// Thrown when an application does not have the privilege to access this method. /// The required feature is not supported. /// The operation is invalid. - /// The argument is wrong + /// The argument is wrong. public void InvokeCommand(uint commandID, Parameter[] paramlist) { Interop.TEEC_Operation op = new Interop.TEEC_Operation(); @@ -370,20 +370,20 @@ namespace Tizen.Security.TEEC } /// - /// Asynchronous version of InvokeCommand + /// The asynchronous version of the InvokeCommand. /// /// 3 - /// The command - /// The array of parameters - /// The token for task manipulation - /// Returns Task executing invoke command in backgroung + /// The command. + /// The array of parameters. + /// The token for task manipulation. + /// Returns a task executing an invoke command in the background. /// http://tizen.org/privilege/tee.client /// partner /// http://tizen.org/feature/security.tee - /// Thrown when application does not have privilege to access this method. + /// Thrown when an application does not have the privilege to access this method. /// The required feature is not supported. /// The operation is invalid. - /// One of arguments is wrong + /// One of the arguments is wrong. public async Task InvokeCommandAsync(uint commandID, Parameter[] paramlist, CancellationToken token = default(CancellationToken)) { await Task.Factory.StartNew(() => InvokeCommand(commandID, paramlist)); @@ -400,15 +400,15 @@ namespace Tizen.Security.TEEC private Interop.TEEC_Context context; /// - /// 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 default TEE). + /// 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). /// /// 3 - /// The TEE name + /// The TEE name. /// http://tizen.org/privilege/tee.client /// partner /// http://tizen.org/feature/security.tee - /// Thrown when application does not have privilege to access this method. + /// Thrown when an application does not have the privilege to access this method. /// The required feature is not supported. /// The operation is invalid. public Context(string name) @@ -424,7 +424,7 @@ namespace Tizen.Security.TEEC } /// - /// This function implements IDisposable interface + /// This function implements the IDisposable interface. /// /// 3 /// http://tizen.org/privilege/tee.client @@ -436,23 +436,23 @@ namespace Tizen.Security.TEEC } /// - /// This function opens a new Session between the Client Application and the specified Trusted Application. - /// The target Trusted Application is identified by a UUID passed in the parameter destination. - /// There can be up to four Parameter objects given in the array + /// 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 array. /// /// 3 - /// The UUID of destination TA - /// The authentication algorithm - /// The data to be verified by given login method - /// The parameters to be passed to TA open-session-callback - /// Returns opened session + /// The UUID of the destination TA. + /// The authentication algorithm . + /// The data to be verified by a given login method. + /// The parameters to be passed to TA open-session-callback. + /// Returns opened session. /// http://tizen.org/privilege/tee.client /// partner /// http://tizen.org/feature/security.tee - /// Thrown when application does not have privilege to access this method. + /// Thrown when an application does not have the privilege to access this method. /// The required feature is not supported. /// The operation is invalid. - /// One of arguments is wrong + /// One of the arguments is wrong. public Session OpenSession(Guid destination, uint loginMethod, byte[] connectionData, Parameter[] paramlist) { Session ses = new Session(context); @@ -460,15 +460,15 @@ namespace Tizen.Security.TEEC return ses; } /// - /// @see OpenSession(Guid destination, uint connectionMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token) + /// @see OpenSession (Guid destination, uint connectionMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token). /// /// 3 - /// The UUID of destination TA - /// Returns opened session + /// The UUID of the destination TA. + /// Returns opened session. /// http://tizen.org/privilege/tee.client /// partner /// http://tizen.org/feature/security.tee - /// Thrown when application does not have privilege to access this method. + /// Thrown when an application does not have the privilege to access this method. /// The required feature is not supported. /// The operation is invalid. public Session OpenSession(Guid destination) @@ -479,23 +479,23 @@ namespace Tizen.Security.TEEC } /// - /// Asynchronous version of OpenSession - /// @see OpenSession(Guid destination, uint connectionMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token) + /// The asynchronous version of the OpenSession. + /// @see OpenSession (Guid destination, uint connectionMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token). /// /// 3 - /// The UUID of destination TA - /// The authentication algorithm - /// The data to be verified by given login method - /// The parameters to be passed to TA open-session-callback - /// The token for task manipulation - /// Returns Task executing session open in backgroung + /// The UUID of the destination TA. + /// The authentication algorithm . + /// The data to be verified by a given login method. + /// The parameters to be passed to the TA open-session-callback. + /// The token for the task manipulation. + /// Returns a Task executing the session open in the background. /// http://tizen.org/privilege/tee.client /// partner /// http://tizen.org/feature/security.tee - /// Thrown when application does not have privilege to access this method. + /// Thrown when an application does not have the privilege to access this method. /// The required feature is not supported. /// The operation is invalid. - /// One of arguments is wrong + /// One of the arguments is wrong. public async Task OpenSessionAsync(Guid destination, uint loginMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token = default(CancellationToken)) { Task task = Task.Factory.StartNew(() => @@ -505,17 +505,17 @@ namespace Tizen.Security.TEEC return await task; } /// - /// Asynchronous version of OpenSession - /// @see OpenSession(Guid destination, uint connectionMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token) + /// The asynchronous version of the OpenSession. + /// @see OpenSession (Guid destination, uint connectionMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token). /// /// 3 - /// The UUID of destination TA - /// The token for task manipulation - /// Returns Task executing session open in backgroung + /// The UUID of the destination TA. + /// The token for a task manipulation. + /// Returns a task executing session open in the background. /// http://tizen.org/privilege/tee.client /// partner /// http://tizen.org/feature/security.tee - /// Thrown when application does not have privilege to access this method. + /// Thrown when an application does not have the privilege to access this method. /// The required feature is not supported. /// The operation is invalid. public async Task OpenSessionAsync(Guid destination, CancellationToken token = default(CancellationToken)) @@ -528,22 +528,22 @@ namespace Tizen.Security.TEEC } /// - /// This function registers a block of existing Client Application memory as a block of Shared Memory within - /// the scope of the specified Context, in accordance with the parameters. - /// The input MUST point to the shared memory region to register + /// 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 must point to the shared memory region to register. /// /// 3 - /// The address of shared memory - /// The size of shared memory - /// The flags describing access modes (Input and/or Output) - /// Returns SharedMemory handler + /// The address of the shared memory. + /// The size of the shared memory. + /// The flags describing the access modes (Input and/or Output). + /// Returns the SharedMemory handler. /// http://tizen.org/privilege/tee.client /// partner /// http://tizen.org/feature/security.tee - /// Thrown when application does not have privilege to access this method. + /// Thrown when an application does not have the privilege to access this method. /// The required feature is not supported. /// The operation is invalid. - /// The argument is wrong + /// The argument is wrong. public SharedMemory RegisterSharedMemory(IntPtr memaddr, UInt32 size, SharedMemoryFlags flags) { Interop.TEEC_SharedMemory shm = new Interop.TEEC_SharedMemory(); @@ -556,17 +556,17 @@ namespace Tizen.Security.TEEC } /// - /// 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. + /// 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. /// /// 3 - /// The size of shared memory - /// The flags describing access modes (Input and/or Output) - /// Returns SharedMemory handler + /// The size of shared memory. + /// The flags describing access modes (Input and/or Output). + /// Returns the Shared Memory handler. /// http://tizen.org/privilege/tee.client /// partner /// http://tizen.org/feature/security.tee - /// Thrown when application does not have privilege to access this method. + /// Thrown when an application does not have the privilege to access this method. /// The required feature is not supported. /// The operation is invalid. public SharedMemory AllocateSharedMemory(UInt32 size, SharedMemoryFlags flags) @@ -580,26 +580,26 @@ namespace Tizen.Security.TEEC } /// - /// This function deregisters or deallocates a previously initialized block of Shared Memory. + /// This function deregisters or deallocates a previously initialized block of the shared memory. /// /// - /// 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 sharedMem + /// 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 + /// 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. /// /// 3 - /// The shared memory object returned by RegisterSharedMemory or AllocateSharedMemory + /// The shared memory object returned by RegisterSharedMemory or AllocateSharedMemory. /// http://tizen.org/privilege/tee.client /// partner /// http://tizen.org/feature/security.tee - /// Thrown when application does not have privilege to access this method. + /// Thrown when an application does not have the privilege to access this method. /// The required feature is not supported. /// The operation is invalid. - /// The argument is wrong + /// The argument is wrong. public void ReleaseSharedMemory(SharedMemory shm) { Interop.Libteec.ReleaseSharedMemory(ref shm.shm); diff --git a/Tizen.Security.TEEC/Tizen.Security.TEEC/NamespaceDoc.cs b/Tizen.Security.TEEC/Tizen.Security.TEEC/NamespaceDoc.cs index 36e1b15..4edd144 100644 --- a/Tizen.Security.TEEC/Tizen.Security.TEEC/NamespaceDoc.cs +++ b/Tizen.Security.TEEC/Tizen.Security.TEEC/NamespaceDoc.cs @@ -12,7 +12,7 @@ running inside the TEE or exposed externally to Client Applications. The TEE Client API concentrates on the interface to enable efficient communications between a Client Application and a Trusted Application running inside the TEE. Higher level standards and protocol layers may be built on top of the foundation -provided by the TEE Client API – for example, to cover common tasks such as secure storage, +provided by the TEE Client API – for example, to cover common tasks, such as secure storage, cryptography, and run-time installation of new Trusted Applications. The separation between the rich environment and the TEE is guaranted. @@ -24,7 +24,7 @@ The key design principles of the TEE Client API are: Where possible the design of the TEE Client API has placed the responsibility for memory allocation on the calling Client Application code. This gives the Client developer choice of - memory allocation locations, enabling simple optimizations such as stack-based allocation + memory allocation locations, enabling simple optimizations, such as stack-based allocation or enhanced flexibility using placements in static global memory or thread-local storage.
This design choice is evident in the API by the use of pointers to structures rather than opaque handles to represent any manipulated objects. -- 2.7.4