My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Typedefs | Enumerations | Functions
otz_tee_internal_storage_api.h File Reference
#include <otz_tee_common.h>
#include <sw_common_types.h>
#include <otz_api.h>
#include <otz_tee_arith_api.h>

Go to the source code of this file.

Macros

#define TEE_DATA_MAX_POSITION   0xFFFFFFFF
 Miscellaneous_Constants. More...
 
#define TEE_OBJECT_ID_MAX_LEN   64
 

Typedefs

typedef struct
__TEE_ObjectEnumHandle * 
TEE_ObjectEnumHandle
 
typedef signed int int32_t
 

Enumerations

enum  TEE_Whence { TEE_DATA_SEEK_SET = 0, TEE_DATA_SEEK_CUR, TEE_DATA_SEEK_END }
 
enum  Object_Storage_Constants { TEE_OBJECT_STORAGE_PRIVATE = 0x00000001 }
 
enum  Data_Flag_Constants {
  TEE_DATA_FLAG_ACCESS_READ = 0x00000001, TEE_DATA_FLAG_ACCESS_WRITE = 0x00000002, TEE_DATA_FLAG_ACCESS_WRITE_META = 0x00000004, TEE_DATA_FLAG_SHARE_READ = 0x00000010,
  TEE_DATA_FLAG_SHARE_WRITE = 0x00000020, TEE_DATA_FLAG_CREATE = 0x00000200, TEE_DATA_FLAG_EXCLUSIVE = 0x00000400
}
 
enum  Usage_Constants {
  TEE_USAGE_EXTRACTABLE = 0x00000001, TEE_USAGE_ENCRYPT = 0x00000002, TEE_USAGE_DECRYPT = 0x00000004, TEE_USAGE_MAC = 0x00000008,
  TEE_USAGE_SIGN = 0x00000010, TEE_USAGE_VERIFY = 0x00000020, TEE_USAGE_DERIVE = 0x00000040
}
 
enum  Handle_Flag_Constants { TEE_HANDLE_FLAG_PERSISTENT = 0x00010000, TEE_HANDLE_FLAG_INITIALIZED = 0x00020000, TEE_HANDLE_FLAG_KEY_SET = 0x00040000, TEE_HANDLE_FLAG_EXPECT_TWO_KEYS = 0x00080000 }
 
enum  TEE_AllocateTransientObject {
  TEE_TYPE_AES, TEE_TYPE_DES, TEE_TYPE_DES3, TEE_TYPE_HMAC_MD5,
  TEE_TYPE_HMAC_SHA1, TEE_TYPE_HMAC_SHA224, TEE_TYPE_HMAC_SHA256, TEE_TYPE_HMAC_SHA384,
  TEE_TYPE_HMAC_SHA512, TEE_TYPE_RSA_PUBLIC_KEY, TEE_TYPE_RSA_KEYPAIR, TEE_TYPE_DSA_PUBLIC_KEY,
  TEE_TYPE_DSA_KEYPAIR, TEE_TYPE_DH_KEYPAIR, TEE_TYPE_GENERIC_SECRET
}
 

Functions

void TEE_GetObjectInfo (TEE_ObjectHandle object, TEE_ObjectInfo *objectInfo)
 Returns the characteristics of an object. More...
 
void TEE_RestrictObjectUsage (TEE_ObjectHandle object, uint32_t objectUsage)
 Restricts the object usage flag of an object handled. More...
 
TEE_Result TEE_GetObjectBufferAttribute (TEE_ObjectHandle object, uint32_t attributeID, void *buffer, size_t *size)
 Extracts one buffer attribute from an object attribute identified by the attributeID. More...
 
TEE_Result TEE_GetObjectValueAttribute (TEE_ObjectHandle object, uint32_t attributeID, uint32_t *a, uint32_t *b)
 Extracts one value attribute from an object attribute identified by the attributeID. More...
 
void TEE_CloseObject (TEE_ObjectHandle object)
 closes an opened object handle. The object can be persistent or transient More...
 
TEE_Result TEE_AllocateTransientObject (uint32_t objectType, uint32_t maxObjectSize, TEE_ObjectHandle *object)
 Allocates an uninitialized transient object. More...
 
void TEE_FreeTransientObject (TEE_ObjectHandle object)
 deallocates a transient object previously allocated with TEE_AllocateTransientObject More...
 
void TEE_ResetTransientObject (TEE_ObjectHandle object)
 Resets a transient object to its initial state after allocation. More...
 
TEE_Result TEE_PopulateTransientObject (TEE_ObjectHandle object, TEE_Attribute *attrs, uint32_t attrCount)
 Function populates an uninitialized object container with object attributes passed by the TA in the attrs parameter. More...
 
void TEE_InitRefAttribute (TEE_Attribute *attr, uint32_t attributeID, void *buffer, size_t length)
 Helper function that can be used to populate a single attribute with reference to a buffer. More...
 
void TEE_InitValueAttribute (TEE_Attribute *attr, uint32_t attributeID, uint32_t a, uint32_t b)
 Helper function that can be used to populate a single attribute with reference to integer value. More...
 
void TEE_CopyObjectAttributes (TEE_ObjectHandle destObject, TEE_ObjectHandle srcObject)
 function populates an uninitialized object handle destObject with the attributes of another object handle srcObject More...
 
TEE_Result TEE_GenerateKey (TEE_ObjectHandle object, uint32_t keySize, TEE_Attribute *params, uint32_t paramCount)
 generates a random key or a key-pair and populates a transient key object with the generated key material More...
 
TEE_Result TEE_OpenPersistentObject (uint32_t storageID, void *objectID, size_t objectIDLen, uint32_t flags, TEE_ObjectHandle *object)
 Opens a handle on an existing persistent object. More...
 
TEE_Result TEE_CreatePersistentObject (uint32_t storageID, void *objectID, size_t objectIDLen, uint32_t flags, TEE_ObjectHandle attributes, void *initialData, size_t initialDataLen, TEE_ObjectHandle *object)
 Creates a persistent object with initial attributes and an initial data stream content, and optionally returns a handle on the created object. More...
 
void TEE_CloseAndDeletePersistentObject (TEE_ObjectHandle object)
 Marks an object for deletion and closes the object handle. More...
 
TEE_Result TEE_RenamePersistentObject (TEE_ObjectHandle object, void *newObjectID, size_t newObjectIDLen)
 Changes the identifier of the object. More...
 
TEE_Result TEE_AllocatePersistentObjectEnumerator (TEE_ObjectEnumHandle *objectEnumerator)
 Allocates a handle on an object enumerator. Once an object enumerator handle has been allocated it can be reused for multiple enumerations. More...
 
void TEE_FreePersistentObjectEnumerator (TEE_ObjectEnumHandle objectEnumerator)
 Deallocates all resources associated with an object enumerator handle. After this function is called, the handle is no longer valid. More...
 
void TEE_ResetPersistentObjectEnumerator (TEE_ObjectEnumHandle objectEnumerator)
 Resets an object enumerator handle to its initial state after allocation. More...
 
TEE_Result TEE_StartPersistentObjectEnumerator (TEE_ObjectEnumHandle objectEnumerator, uint32_t storageID)
 Starts the enumeration of all the persistent objects in a given Trusted Storage. More...
 
TEE_Result TEE_GetNextPersistentObject (TEE_ObjectEnumHandle objectEnumerator, TEE_ObjectInfo objectInfo, void *objectID, size_t *objectIDLen)
 Gets the next object in an enumeration and returns information about the object: type, size, identifier, etc. More...
 
TEE_Result TEE_ReadObjectData (TEE_ObjectHandle object, void *buffer, size_t size, uint32_t *count)
 Attempts to read size bytes from the data stream associated with the object into the buffer. More...
 
TEE_Result TEE_WriteObjectData (TEE_ObjectHandle object, void *buffer, size_t size)
 Writes size bytes from the buffer to the date stream associated with the open object handle. More...
 
TEE_Result TEE_TruncateObjectData (TEE_ObjectHandle object, uint32_t size)
 Changes the size of data stream. More...
 
TEE_Result TEE_SeekObjectData (TEE_ObjectHandle object, int32_t offset, TEE_Whence whence)
 Sets the data position indicator associated with the object handle. More...
 

Macro Definition Documentation

#define TEE_DATA_MAX_POSITION   0xFFFFFFFF

Miscellaneous_Constants.

#define TEE_OBJECT_ID_MAX_LEN   64

Typedef Documentation

typedef signed int int32_t
Parameters
object
offset
whence
Returns
typedef struct __TEE_ObjectEnumHandle* TEE_ObjectEnumHandle

Enumeration Type Documentation

Enumerator
TEE_DATA_FLAG_ACCESS_READ 
TEE_DATA_FLAG_ACCESS_WRITE 
TEE_DATA_FLAG_ACCESS_WRITE_META 
TEE_DATA_FLAG_SHARE_READ 
TEE_DATA_FLAG_SHARE_WRITE 
TEE_DATA_FLAG_CREATE 
TEE_DATA_FLAG_EXCLUSIVE 
Enumerator
TEE_HANDLE_FLAG_PERSISTENT 
TEE_HANDLE_FLAG_INITIALIZED 
TEE_HANDLE_FLAG_KEY_SET 
TEE_HANDLE_FLAG_EXPECT_TWO_KEYS 
Enumerator
TEE_OBJECT_STORAGE_PRIVATE 
Enumerator
TEE_TYPE_AES 
TEE_TYPE_DES 
TEE_TYPE_DES3 
TEE_TYPE_HMAC_MD5 
TEE_TYPE_HMAC_SHA1 
TEE_TYPE_HMAC_SHA224 
TEE_TYPE_HMAC_SHA256 
TEE_TYPE_HMAC_SHA384 
TEE_TYPE_HMAC_SHA512 
TEE_TYPE_RSA_PUBLIC_KEY 
TEE_TYPE_RSA_KEYPAIR 
TEE_TYPE_DSA_PUBLIC_KEY 
TEE_TYPE_DSA_KEYPAIR 
TEE_TYPE_DH_KEYPAIR 
TEE_TYPE_GENERIC_SECRET 
enum TEE_Whence
Enumerator
TEE_DATA_SEEK_SET 
TEE_DATA_SEEK_CUR 
TEE_DATA_SEEK_END 
Enumerator
TEE_USAGE_EXTRACTABLE 
TEE_USAGE_ENCRYPT 
TEE_USAGE_DECRYPT 
TEE_USAGE_MAC 
TEE_USAGE_SIGN 
TEE_USAGE_VERIFY 
TEE_USAGE_DERIVE 

Function Documentation

TEE_Result TEE_AllocatePersistentObjectEnumerator ( TEE_ObjectEnumHandle objectEnumerator)

Allocates a handle on an object enumerator. Once an object enumerator handle has been allocated it can be reused for multiple enumerations.

Parameters
objectEnumerator
Returns
TEE_Result TEE_AllocateTransientObject ( uint32_t  objectType,
uint32_t  maxObjectSize,
TEE_ObjectHandle object 
)

Allocates an uninitialized transient object.

Parameters
objectType
maxObjectSize
object
Returns
void TEE_CloseAndDeletePersistentObject ( TEE_ObjectHandle  object)

Marks an object for deletion and closes the object handle.

Parameters
object
void TEE_CloseObject ( TEE_ObjectHandle  object)

closes an opened object handle. The object can be persistent or transient

Parameters
object
void TEE_CopyObjectAttributes ( TEE_ObjectHandle  destObject,
TEE_ObjectHandle  srcObject 
)

function populates an uninitialized object handle destObject with the attributes of another object handle srcObject

Parameters
destObject
srcObject
destObjecthandle on uninitialized object handle
srcObjecthandle on an initialized object
TEE_Result TEE_CreatePersistentObject ( uint32_t  storageID,
void *  objectID,
size_t  objectIDLen,
uint32_t  flags,
TEE_ObjectHandle  attributes,
void *  initialData,
size_t  initialDataLen,
TEE_ObjectHandle object 
)

Creates a persistent object with initial attributes and an initial data stream content, and optionally returns a handle on the created object.

Parameters
storageID
objectID
objectIDLen
flags
attributes
initialData
initialDataLen
object
Returns
void TEE_FreePersistentObjectEnumerator ( TEE_ObjectEnumHandle  objectEnumerator)

Deallocates all resources associated with an object enumerator handle. After this function is called, the handle is no longer valid.

Parameters
objectEnumerator
void TEE_FreeTransientObject ( TEE_ObjectHandle  object)

deallocates a transient object previously allocated with TEE_AllocateTransientObject

Parameters
object
TEE_Result TEE_GenerateKey ( TEE_ObjectHandle  object,
uint32_t  keySize,
TEE_Attribute params,
uint32_t  paramCount 
)

generates a random key or a key-pair and populates a transient key object with the generated key material

Parameters
object
keySize
params
paramCount
Returns
TEE_Result TEE_GetNextPersistentObject ( TEE_ObjectEnumHandle  objectEnumerator,
TEE_ObjectInfo  objectInfo,
void *  objectID,
size_t objectIDLen 
)

Gets the next object in an enumeration and returns information about the object: type, size, identifier, etc.

Parameters
objectEnumerator
objectInfo
objectID
objectIDLen
Returns
TEE_Result TEE_GetObjectBufferAttribute ( TEE_ObjectHandle  object,
uint32_t  attributeID,
void *  buffer,
size_t size 
)

Extracts one buffer attribute from an object attribute identified by the attributeID.

Parameters
object
attributeID
buffer
size
Returns
void TEE_GetObjectInfo ( TEE_ObjectHandle  object,
TEE_ObjectInfo objectInfo 
)

Returns the characteristics of an object.

Parameters
object
objectInfo
TEE_Result TEE_GetObjectValueAttribute ( TEE_ObjectHandle  object,
uint32_t  attributeID,
uint32_t a,
uint32_t b 
)

Extracts one value attribute from an object attribute identified by the attributeID.

Parameters
object
attributeID
a
b
Returns
void TEE_InitRefAttribute ( TEE_Attribute attr,
uint32_t  attributeID,
void *  buffer,
size_t  length 
)

Helper function that can be used to populate a single attribute with reference to a buffer.

Parameters
attr
attributeID
buffer
length
void TEE_InitValueAttribute ( TEE_Attribute attr,
uint32_t  attributeID,
uint32_t  a,
uint32_t  b 
)

Helper function that can be used to populate a single attribute with reference to integer value.

Parameters
attr
attributeID
a
b
TEE_Result TEE_OpenPersistentObject ( uint32_t  storageID,
void *  objectID,
size_t  objectIDLen,
uint32_t  flags,
TEE_ObjectHandle object 
)

Opens a handle on an existing persistent object.

Parameters
storageID
objectID
objectIDLen
flags
object
Returns
TEE_Result TEE_PopulateTransientObject ( TEE_ObjectHandle  object,
TEE_Attribute attrs,
uint32_t  attrCount 
)

Function populates an uninitialized object container with object attributes passed by the TA in the attrs parameter.

Parameters
object
attrs
attrCount
Returns
TEE_Result TEE_ReadObjectData ( TEE_ObjectHandle  object,
void *  buffer,
size_t  size,
uint32_t count 
)

Attempts to read size bytes from the data stream associated with the object into the buffer.

Parameters
object
buffer
size
count
Returns
TEE_Result TEE_RenamePersistentObject ( TEE_ObjectHandle  object,
void *  newObjectID,
size_t  newObjectIDLen 
)

Changes the identifier of the object.

Parameters
object
newObjectID
newObjectIDLen
Returns
void TEE_ResetPersistentObjectEnumerator ( TEE_ObjectEnumHandle  objectEnumerator)

Resets an object enumerator handle to its initial state after allocation.

Parameters
objectEnumerator
void TEE_ResetTransientObject ( TEE_ObjectHandle  object)

Resets a transient object to its initial state after allocation.

Parameters
object
void TEE_RestrictObjectUsage ( TEE_ObjectHandle  object,
uint32_t  objectUsage 
)

Restricts the object usage flag of an object handled.

Parameters
object
objectUsage
TEE_Result TEE_SeekObjectData ( TEE_ObjectHandle  object,
int32_t  offset,
TEE_Whence  whence 
)

Sets the data position indicator associated with the object handle.

Parameters
object
offset
whence
Returns
TEE_Result TEE_StartPersistentObjectEnumerator ( TEE_ObjectEnumHandle  objectEnumerator,
uint32_t  storageID 
)

Starts the enumeration of all the persistent objects in a given Trusted Storage.

Parameters
objectEnumerator
storageID
Returns
TEE_Result TEE_TruncateObjectData ( TEE_ObjectHandle  object,
uint32_t  size 
)

Changes the size of data stream.

Parameters
object
size
Returns
TEE_Result TEE_WriteObjectData ( TEE_ObjectHandle  object,
void *  buffer,
size_t  size 
)

Writes size bytes from the buffer to the date stream associated with the open object handle.

Parameters
object
buffer
size
Returns