SST: Add asset types and attributes

This patch adds asset types and attributes to be used by the asset
manager to complement the asset policy in the future (i.e. if an
asset has expired, do not return the asset content in a read
request). The asset type and attributes can also be used by other
services to use the asset in different ways based on the set of
attributes.

The patch also updates the SST code as follows:
- add macros to check the asset types and attributes
- update object header store the new types and attributes
- add get and set asset attributes APIs in all the SST service layers
- add a simple test to verify new APIs (get and set attributes)
- add tfm_sst_asset_info_t and updates APIs in all the SST service
  layers
- increase veneers regions to fit the new get/set assets attributes
  APIs in all the reference targets

Change-Id: I5c678834ffdc9e2447ab046ab4131785d341ed26
Signed-off-by: Marc Moreno <marc.morenoberengue@arm.com>
diff --git a/interface/include/tfm_ns_svc.h b/interface/include/tfm_ns_svc.h
index 28c7589..b283dc6 100644
--- a/interface/include/tfm_ns_svc.h
+++ b/interface/include/tfm_ns_svc.h
@@ -44,6 +44,8 @@
     X(SVC_TFM_SST_GET_HANDLE, tfm_sst_svc_get_handle) \
     X(SVC_TFM_SST_CREATE, tfm_sst_svc_create) \
     X(SVC_TFM_SST_GET_INFO, tfm_sst_svc_get_info) \
+    X(SVC_TFM_SST_GET_ATTRIBUTES, tfm_sst_svc_get_attributes) \
+    X(SVC_TFM_SST_SET_ATTRIBUTES, tfm_sst_svc_set_attributes) \
     X(SVC_TFM_SST_READ, tfm_sst_svc_read) \
     X(SVC_TFM_SST_WRITE, tfm_sst_svc_write) \
     X(SVC_TFM_SST_DELETE, tfm_sst_svc_delete) \
diff --git a/interface/include/tfm_sst_api.h b/interface/include/tfm_sst_api.h
index d22653c..1ce8261 100644
--- a/interface/include/tfm_sst_api.h
+++ b/interface/include/tfm_sst_api.h
@@ -52,6 +52,31 @@
                                     struct tfm_sst_asset_info_t *info);
 
 /**
+ * \brief Gets asset's attributes referenced by asset handler.
+ *
+ * \param[in]  asset_handle  Asset handler
+ * \param[out] attrs         Pointer to store the asset's attributes
+ *                           \ref tfm_sst_asset_attrs_t
+ *
+ *
+ * \return Returns error code as specified in \ref tfm_sst_err_t
+ */
+enum tfm_sst_err_t tfm_sst_get_attributes(uint32_t asset_handle,
+                                          struct tfm_sst_asset_attrs_t *attrs);
+
+/**
+ * \brief Sets asset's attributes referenced by asset handler.
+ *
+ * \param[in]  asset_handle  Asset handler
+ * \param[in]  attrs         Pointer to new the asset's attributes
+ *                           \ref tfm_sst_asset_attrs_t
+ *
+ * \return Returns error code as specified in \ref tfm_sst_err_t
+ */
+enum tfm_sst_err_t tfm_sst_set_attributes(uint32_t asset_handle,
+                                     const struct tfm_sst_asset_attrs_t *attrs);
+
+/**
  * \brief Reads asset's data from asset referenced by asset handler.
  *
  * \param[in]  asset_handle   Asset handler
diff --git a/interface/include/tfm_sst_asset_defs.h b/interface/include/tfm_sst_asset_defs.h
new file mode 100644
index 0000000..e97d836
--- /dev/null
+++ b/interface/include/tfm_sst_asset_defs.h
@@ -0,0 +1,404 @@
+/*
+ * Copyright (c) 2018, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#ifndef __TFM_SST_ASSET_DEFS_H__
+#define __TFM_SST_ASSET_DEFS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <inttypes.h>
+#include <limits.h>
+
+/* List of TF-M SST asset category types */
+/*!
+ * \def TFM_SST_ASSET_CAT_TYPE_NONE
+ *
+ * \brief Asset category type NONE. This is value used in an asset when the
+ *        asset category type is not set.
+ */
+#define TFM_SST_ASSET_CAT_TYPE_NONE            ((uint32_t)0x00000000)
+
+/*!
+ * \def TFM_SST_ASSET_CAT_RAW_DATA
+ *
+ * \brief This category type is used for those assets which contains raw data.
+ */
+#define TFM_SST_ASSET_CAT_RAW_DATA             ((uint32_t)0x02000000)
+
+/*!
+ * \def TFM_SST_ASSET_CAT_KEY_SYMMETRIC
+ *
+ * \brief This category type is used for those assets which contains a
+ *        symmetric key.
+ */
+#define TFM_SST_ASSET_CAT_KEY_SYMMETRIC        ((uint32_t)0x04000000)
+
+/*!
+ * \def TFM_SST_ASSET_CAT_KEY_PUBLIC
+ *
+ * \brief This category type is used for those assets which contains an
+ *        asymmetric public key.
+ */
+#define TFM_SST_ASSET_CAT_KEY_PUBLIC           ((uint32_t)0x06000000)
+
+/*!
+ * \def TFM_SST_ASSET_CAT_KEY_PRIVATE
+ *
+ * \brief This category type is used for those assets which contains an
+ *        asymmetric private key.
+ */
+#define TFM_SST_ASSET_CAT_KEY_PRIVATE          ((uint32_t)0x07000000)
+
+/*!
+ * \def TFM_SST_ASSET_CAT_CERTIFICATE
+ *
+ * \brief This category type is used for those assets which contains a
+ *        certificate.
+ */
+#define TFM_SST_ASSET_CAT_CERTIFICATE          ((uint32_t)0x08000000)
+
+/*!
+ * \def TFM_SST_ASSET_CAT_VENDOR_DEFINED
+ *
+ * \brief This category type is used when assets is vendor defined.
+ */
+#define TFM_SST_ASSET_CAT_VENDOR_DEFINED       ((uint32_t)0x80000000)
+
+/* TF-M SST asset category type masks */
+/*!
+ * \def TFM_SST_ASSET_CAT_TYPE_MASK
+ *
+ * \brief Asset category type mask.
+ */
+#define TFM_SST_ASSET_CAT_TYPE_MASK            ((uint32_t)0x7f000000)
+
+/*!
+ * \def TFM_SST_ASSET_CAT_KEY_MASK
+ *
+ * \brief Asset key category mask.
+ */
+#define TFM_SST_ASSET_CAT_KEY_MASK             ((uint32_t)0x04000000)
+
+/*!
+ * \def TFM_SST_ASSET_CAT_KEY_ASYMMETRIC_MASK
+ *
+ * \brief Asset asymmetric key mask.
+ */
+#define TFM_SST_ASSET_CAT_KEY_ASYMMETRIC_MASK  ((uint32_t)0x06000000)
+
+
+/* Asset types for raw data category */
+/*!
+ * \def TFM_SST_ASSET_KEY_HMAC
+ *
+ * \brief HMAC key.
+ */
+#define TFM_SST_ASSET_KEY_HMAC    ((TFM_SST_ASSET_CAT_RAW_DATA)| 0x00000001)
+
+/* Asset types for symmetric key category */
+/*!
+ * \def TFM_SST_ASSET_KEY_AES
+ *
+ * \brief AES key to be used in algorithms based on AES cipher
+ *        (cipher, AEAD or MAC).
+ */
+#define TFM_SST_ASSET_KEY_AES     ((TFM_SST_ASSET_CAT_KEY_SYMMETRIC)|0x00000001)
+
+/*!
+ * \def TFM_SST_ASSET_KEY_DES
+ *
+ * \brief DES key to be used in algorithms based on DES or 3DES cipher
+ *        (cipher or MAC).
+ */
+#define TFM_SST_ASSET_KEY_DES     ((TFM_SST_ASSET_CAT_KEY_SYMMETRIC)|0x00000002)
+
+/*!
+ * \def TFM_SST_ASSET_KEY_CAMELLIA
+ *
+ * \brief Camellia key to be used in algorithms based on Camellia cipher
+ *        (cipher, AEAD or MAC).
+ */
+#define TFM_SST_ASSET_KEY_CAMELLIA \
+                                  ((TFM_SST_ASSET_CAT_KEY_SYMMETRIC)|0x00000003)
+
+/* Asset types for asymmetric key category */
+/*!
+ * \def TFM_SST_ASSET_KEY_RSA_PUBLIC
+ *
+ * \brief RSA public key.
+ */
+#define TFM_SST_ASSET_KEY_RSA_PUBLIC ((TFM_SST_ASSET_CAT_KEY_PUBLIC)|0x00010000)
+
+/*!
+ * \def TFM_SST_ASSET_KEY_RSA_PRIVATE
+ *
+ * \brief RSA private key.
+ */
+#define TFM_SST_ASSET_KEY_RSA_PRIVATE \
+                                    ((TFM_SST_ASSET_CAT_KEY_PRIVATE)|0x00010000)
+
+/*!
+ * \def TFM_SST_ASSET_KEY_DSA_PUBLIC
+ *
+ * \brief DSA public key.
+ */
+#define TFM_SST_ASSET_KEY_DSA_PUBLIC ((TFM_SST_ASSET_CAT_KEY_PUBLIC)|0x00020000)
+
+/*!
+ * \def TFM_SST_ASSET_KEY_DSA_PRIVATE
+ *
+ * \brief DSA private key.
+ */
+#define TFM_SST_ASSET_KEY_DSA_PRIVATE \
+                                    ((TFM_SST_ASSET_CAT_KEY_PRIVATE)|0x00020000)
+
+/*!
+ * \def TFM_SST_ASSET_KEY_ECC_PUBLIC
+ *
+ * \brief ECC public key.
+ */
+#define TFM_SST_ASSET_KEY_ECC_PUBLIC ((TFM_SST_ASSET_CAT_KEY_PUBLIC)|0x00030000)
+
+/*!
+ * \def TFM_SST_ASSET_KEY_ECC_PRIVATE
+ *
+ * \brief ECC private key.
+ */
+#define TFM_SST_ASSET_KEY_ECC_PRIVATE \
+                                    ((TFM_SST_ASSET_CAT_KEY_PRIVATE)|0x00030000)
+
+/*!
+ * \def TFM_SST_ASSET_KEY_ECC_CURVE_MASK
+ *
+ * \brief ECC curve mask. This mask allows to encode the curve identifiers which
+ *        are aligned with the TLS Supported Groups Registry (formerly known as
+ *        the  TLS EC Named Curve Registry)
+ *        https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml
+ *        The values are defined by RFC 4492, RFC 7027 and RFC 7919.
+ */
+#define TFM_SST_ASSET_KEY_ECC_CURVE_MASK ((uint32_t)0x0000ffff)
+
+/* Asset types for certificate category */
+/*!
+ * \def TFM_SST_ASSET_CERT_X_509
+ *
+ * \brief X509 certificate.
+ */
+#define TFM_SST_ASSET_CERT_X_509 ((TFM_SST_ASSET_CAT_CERTIFICATE)|0x00000001)
+
+/* List of TF-M SST asset */
+/*!
+ * \def TFM_SST_ASSET_ATTR_EXPIRED
+ *
+ * \brief Indicates if asset has expired.
+ */
+#define TFM_SST_ASSET_ATTR_EXPIRED              ((uint32_t)0x00000001)
+
+/*!
+ * \def TFM_SST_ASSET_ATTR_GENERATED_LOCALLY
+ *
+ * \brief Indicates if asset content has been generated locally.
+ */
+#define TFM_SST_ASSET_ATTR_GENERATED_LOCALLY    ((uint32_t)0x00000002)
+
+/*!
+ * \def TFM_SST_ASSET_ATTR_DERIVATION
+ *
+ * \brief Indicates if asset content can be used in a key derivation (i.e.
+ *        if other keys can be derived from this one)
+ *
+ */
+#define TFM_SST_ASSET_ATTR_DERIVATION           ((uint32_t)0x00000004)
+
+/*!
+ * \def TFM_SST_ASSET_ATTR_TRUSTED
+ *
+ * \brief Indicates if asset content can be trusted.
+ */
+#define TFM_SST_ASSET_ATTR_TRUSTED              ((uint32_t)0x00000008)
+
+/*!
+ * \def TFM_SST_ASSET_ATTR_WRITE_ONCE
+ *
+ * \brief Indicates if asset content can be modified once a content has been
+ *        set.
+ */
+#define TFM_SST_ASSET_ATTR_WRITE_ONCE           ((uint32_t)0x00000010)
+
+/* The next 3 bits are reserved */
+
+/*!
+ * \def TFM_SST_ASSET_ATTR_ENCRYPT
+ *
+ * \brief Indicates if asset content may be used to encrypt data.
+ */
+#define TFM_SST_ASSET_ATTR_ENCRYPT              ((uint32_t)0x00000100)
+
+/*!
+ * \def TFM_SST_ASSET_ATTR_DECRYPT
+ *
+ * \brief Indicates if asset content may be used to decrypt data.
+ */
+#define TFM_SST_ASSET_ATTR_DECRYPT              ((uint32_t)0x00000200)
+
+/*!
+ * \def TFM_SST_ASSET_ATTR_SIGN
+ *
+ * \brief Indicates if asset content may be used to sign data.
+ */
+#define TFM_SST_ASSET_ATTR_SIGN                 ((uint32_t)0x00000400)
+
+/*!
+ * \def TFM_SST_ASSET_ATTR_VERIFY
+ *
+ * \brief Indicates if asset content may be used to verify signed data.
+ */
+#define TFM_SST_ASSET_ATTR_VERIFY               ((uint32_t)0x00000800)
+
+/*!
+ * \def TFM_SST_ASSET_ATTR_VERIFY_RECOVER
+ *
+ * \brief Indicates if asset content may be used to verify data where
+ *        data is recovered from the signature.
+ */
+#define TFM_SST_ASSET_ATTR_VERIFY_RECOVER       ((uint32_t)0x00001000)
+
+/*!
+ * \def TFM_SST_ASSET_ATTR_WRAP
+ *
+ * \brief Indicates if asset content may be used to wrap other data
+ *        (i.e wrap other keys).
+ */
+#define TFM_SST_ASSET_ATTR_WRAP                 ((uint32_t)0x00002000)
+
+/*!
+ * \def TFM_SST_ASSET_ATTR_UNWRAP
+ *
+ * \brief Indicates if asset content may be used to unwrap other data
+ *        (i.e unwrap other keys).
+ */
+#define TFM_SST_ASSET_ATTR_UNWRAP               ((uint32_t)0x00004000)
+
+/*!
+ * \def TFM_SST_ASSET_ATTR_SENSITIVE
+ *
+ * \brief Indicates if asset content is sensitive and cannot be revealed.
+ */
+#define TFM_SST_ASSET_ATTR_SENSITIVE            ((uint32_t)0x00008000)
+
+/*!
+ * \def TFM_SST_ASSET_ATTR_ALWAYS_SENSITIVE
+ *
+ * \brief Indicates if asset has always had the sensitive attribute. Attribute
+ *        cannot be changed once set. It becomes a read only attribute.
+ */
+#define TFM_SST_ASSET_ATTR_ALWAYS_SENSITIVE     ((uint32_t)0x00010000)
+
+/*!
+ * \def TFM_SST_ASSET_ATTR_EXTRACTABLE
+ *
+ * \brief Indicates if asset content is extractable and can be wrapped.
+ */
+#define TFM_SST_ASSET_ATTR_EXTRACTABLE          ((uint32_t)0x00020000)
+
+/*!
+ * \def TFM_SST_ASSET_ATTR_NEVER_EXTRACTABLE
+ *
+ * \brief Indicates if asset has never had the extactable attribute. Attribute
+ *        cannot be changed once set. It becomes a read only attribute.
+ */
+#define TFM_SST_ASSET_ATTR_NEVER_EXTRACTABLE    ((uint32_t)0x00040000)
+
+/*!
+ * \def TFM_SST_ASSET_ATTR_ALWAYS_AUTHENTICATE
+ *
+ * \brief Indicates if user has to be authenticate when the asset content has
+ *        to be used.
+ */
+#define TFM_SST_ASSET_ATTR_ALWAYS_AUTHENTICATE  ((uint32_t)0x00080000)
+
+/*!
+ * \def TFM_SST_ASSET_ATTR_MASK
+ *
+ * \brief Asset attributes mask.
+ */
+#define TFM_SST_ASSET_ATTR_MASK                 ((uint32_t)0x7FFFFFFF)
+
+/*!
+ * \def TFM_SST_ASSET_ATTR_VENDOR_DEFINED
+ *
+ * \brief Indicates if the attribute is vendor defined.
+ */
+#define TFM_SST_ASSET_ATTR_VENDOR_DEFINED       ((uint32_t)0x80000000)
+
+
+/* TF-M SST asset structure definitions */
+/*!
+ * \struct tfm_sst_asset_info_t
+ *
+ * \brief Asset information.
+ */
+struct tfm_sst_asset_info_t {
+    uint32_t type;          /*!< Asset type */
+    uint32_t size_current;  /*!< The current size of the asset content */
+    uint32_t size_max;      /*!< The maximum size of the asset content in
+                             *   bytes
+                             */
+};
+
+/*!
+ * \struct tfm_sst_asset_validity_t
+ *
+ * \brief Asset validity structure.
+ *
+ * \note  Start and end values must be set to 0 as they are reserved for future
+ *        use.
+ */
+struct tfm_sst_asset_validity_t {
+    uint64_t  start; /*!< Start date/time on which the asset validity period
+                      *   begins
+                      */
+    uint64_t  end;   /*!< End date on which the asset validity period ends */
+
+};
+
+/*!
+ * \struct tfm_sst_asset_attrs_t
+ *
+ * \brief Asset attributes structure.
+ *
+ */
+struct tfm_sst_asset_attrs_t {
+    struct tfm_sst_asset_validity_t validity; /*!< Asset validity period */
+    uint32_t attrs;                           /*!< Asset attributes */
+    uint8_t  reserved[4];                     /*!< Reserved for future
+                                               *   expansion. Default value is
+                                               *   0 in all bytes
+                                               */
+};
+
+/*!
+ * \def TFM_SST_ASSET_INFO_SIZE
+ *
+ * \brief Indicates the asset information structure size.
+ */
+#define TFM_SST_ASSET_INFO_SIZE sizeof(struct tfm_sst_asset_info_t)
+
+/*!
+ * \def TFM_SST_ASSET_ATTR_SIZE
+ *
+ * \brief Indicates the asset attributes structure size.
+ */
+#define TFM_SST_ASSET_ATTR_SIZE sizeof(struct tfm_sst_asset_attrs_t)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __TFM_SST_ASSET_DEFS_H__ */
diff --git a/interface/include/tfm_sst_asset_macros.h b/interface/include/tfm_sst_asset_macros.h
new file mode 100644
index 0000000..e97ccbe
--- /dev/null
+++ b/interface/include/tfm_sst_asset_macros.h
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2018, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#ifndef __TFM_SST_ASSET_MACROS_H__
+#define __TFM_SST_ASSET_MACROS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "tfm_sst_asset_defs.h"
+
+/*!
+ * \def TFM_SST_ASSET_IS_ASSET_CAT(sst_def_cat_type, type)
+ *
+ * \brief Macro to check if the asset category type (type) is equal to the
+ *        TF-M SST asset defined category types (sst_def_cat_type).
+ *
+ * \param[in] sst_def_cat_type  TF-M SST asset defined category type
+ * \param[in] type              Asset type
+ *
+ * \return Returns 1 if the asset type is equal to the TF-M SST asset defined
+ *         type. Otherwise, it returns 0.
+ */
+#define TFM_SST_ASSET_IS_ASSET_CAT(sst_def_cat_type, type) \
+        (((type & TFM_SST_ASSET_CAT_VENDOR_DEFINED) != 0) && \
+          ((type & TFM_SST_ASSET_CAT_TYPE_MASK) == sst_def_cat_type))
+
+/*!
+ * \def TFM_SST_ASSET_IS_ASSET_TYPE(sst_def_type, type)
+ *
+ * \brief Macro to check if the asset type (type) is equal to the
+ *        TF-M SST asset defined type (sst_def_type).
+ *
+ * \param[in] sst_def_type  TF-M SST asset defined type
+ * \param[in] type          Asset type
+ *
+ * \return Returns 1 if the asset type is equal to the TF-M SST asset defined
+ *         type. Otherwise, it returns 0.
+ */
+#define TFM_SST_ASSET_IS_ASSET_TYPE(sst_def_type, type) \
+        (((type & TFM_SST_ASSET_CAT_VENDOR_DEFINED) != 0) && \
+          (type == sst_def_type))
+
+/*!
+ * \def TFM_SST_ASSET_IS_VENDOR_DEFINED(type)
+ *
+ * \brief Macro to check if the asset type is vendor defined.
+ *
+ * \param[in] type  Asset type
+ *
+ * \return Returns 1 if the asset type is equal to TFM_SST_ASSET_VENDOR_DEFINED.
+ *         Otherwise, it returns 0.
+ */
+#define TFM_SST_ASSET_IS_VENDOR_DEFINED(type) \
+        ((type & TFM_SST_ASSET_VENDOR_DEFINED) != 0)
+
+/*!
+ * \def TFM_SST_ASSET_IS_KEY_TYPE(type)
+ *
+ * \brief Macro to check if the asset type is a key.
+ *
+ * \param[in] type  Asset type
+ *
+ * \return Returns 1 if it is a key. Otherwise, it returns 0.
+ */
+#define TFM_SST_ASSET_IS_KEY_TYPE(type) \
+        ((type & TFM_SST_ASSET_KEY_MASK) != 0)
+
+/*!
+ * \def TFM_SST_ASSET_IS_ASYMMETRIC_KEY_TYPE(type)
+ *
+ * \brief Macro to check if the asset type is a symmetric key.
+ *
+ * \param[in] type  Asset type
+ *
+ * \return Returns 1 if it is an asymmetric key. Otherwise, it returns 0.
+ */
+#define TFM_SST_ASSET_IS_ASYMMETRIC_KEY_TYPE(type) \
+        ((type & TFM_SST_ASSET_KEY_ASYMMETRIC_MASK) != 0)
+
+/*!
+ * \def TFM_SST_ASSET_HAS_ATTR(sst_def_asset_attr, attrs)
+ *
+ * \brief Macro to check if the asset attributes (attrs) have a specific TF-M
+ *        SST asset defined bit attribute (sst_def_asset_attr).
+ *
+ * \param[in] sst_def_type  TF-M SST asset defined bit attribute
+ * \param[in] attrs         Asset attributes
+ *
+ * \return Returns 1 if the asset has the TF-M SST asset defined
+ *         attribute. Otherwise, it returns 0.
+ */
+#define TFM_SST_ASSET_HAS_ATTR(sst_def_asset_attr, attrs) \
+        (((attrs & sst_def_asset_attr) != 0) && \
+         ((attrs & TFM_SST_ASSET_ATTR_VENDOR_DEFINED) == 0))
+
+/*!
+ * \def TFM_SST_ASSET_HAS_ATTR_VENDOR_DEFINED(attrs)
+ *
+ * \brief Macro to check if the asset attributes are vendor defined.
+ *
+ * \param[in] attrs  Asset attributes
+ *
+ * \return Returns 1 if the asset type is equal to TFM_SST_ASSET_VENDOR_DEFINED.
+ *         Otherwise, it returns 0.
+ */
+#define TFM_SST_ASSET_HAS_ATTR_VENDOR_DEFINED(attrs) \
+        ((attrs & TFM_SST_ASSET_ATTR_VENDOR_DEFINED) != 0)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __TFM_SST_ASSET_MACROS_H__ */
diff --git a/interface/include/tfm_sst_defs.h b/interface/include/tfm_sst_defs.h
index 83ac62d..1fac2ad 100644
--- a/interface/include/tfm_sst_defs.h
+++ b/interface/include/tfm_sst_defs.h
@@ -15,6 +15,8 @@
 #include <inttypes.h>
 #include <limits.h>
 #include "tfm_api.h"
+#include "tfm_sst_asset_defs.h"
+#include "tfm_sst_asset_macros.h"
 
 /* FIXME: the secure APP ID should not be share with the non-secure code
  *        as it is revealing information about secure code implementation.
@@ -53,18 +55,6 @@
 };
 
 /*!
- * \struct tfm_sst_asset_info_t
- *
- * \brief Structure to store the asset information concerning the content
- *        information.
- *
- */
-struct tfm_sst_asset_info_t {
-    uint32_t size_current; /*!< The current size of the asset data */
-    uint32_t size_max;     /*!< The maximum size of the asset data in bytes */
-};
-
-/*!
  * \struct tfm_sst_buf_t
  *
  * \brief Structure to store data information to read/write from/to asset.
@@ -76,8 +66,6 @@
     uint32_t offset; /*!< Offset within asset */
 };
 
-#define TFM_SST_ASSET_INFO_SIZE sizeof(struct tfm_sst_asset_info_t)
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/interface/include/tfm_sst_svc_handler.h b/interface/include/tfm_sst_svc_handler.h
index b983869..18e06d3 100644
--- a/interface/include/tfm_sst_svc_handler.h
+++ b/interface/include/tfm_sst_svc_handler.h
@@ -52,6 +52,34 @@
                                        struct tfm_sst_asset_info_t *info);
 
 /**
+ * \brief SVC funtion to get asset's attributes referenced by asset
+ *        handler.
+ *
+ * \param[in]  asset_handle  Asset handler
+ * \param[out] attrs         Pointer to store the asset's attributes
+ *                           \ref tfm_sst_asset_attrs_t
+ *
+ * \return Returns error code as specified in \ref tfm_sst_err_t
+ */
+enum tfm_sst_err_t tfm_sst_svc_get_attributes(
+                                           uint32_t asset_handle,
+                                           struct tfm_sst_asset_attrs_t *attrs);
+
+/**
+ * \brief SVC funtion to set asset's attributes referenced by asset
+ *        handler.
+ *
+ * \param[in] asset_handle  Asset handler
+ * \param[in] attrs         Pointer to new the asset's attributes
+ *                           \ref tfm_sst_asset_attrs_t
+ *
+ * \return Returns error code as specified in \ref tfm_sst_err_t
+ */
+enum tfm_sst_err_t tfm_sst_svc_set_attributes(
+                                     uint32_t asset_handle,
+                                     const struct tfm_sst_asset_attrs_t *attrs);
+
+/**
  * \brief SVC funtion to read asset's data from asset referenced by asset
  *        handler.
  *
diff --git a/interface/include/tfm_sst_veneers.h b/interface/include/tfm_sst_veneers.h
index b76abbf..108ea97 100644
--- a/interface/include/tfm_sst_veneers.h
+++ b/interface/include/tfm_sst_veneers.h
@@ -59,6 +59,35 @@
                                            struct tfm_sst_asset_info_t *info);
 
 /**
+ * \brief Gets asset's attributes referenced by asset handler.
+ *
+ * \param[in]  app_id        Application ID
+ * \param[in]  asset_handle  Asset handler
+ * \param[out] attrs         Pointer to store the asset's attributes
+ *
+ * \return Returns error code as specified in \ref tfm_sst_err_t
+ */
+enum tfm_sst_err_t tfm_sst_veneer_get_attributes(
+                                           uint32_t app_id,
+                                           uint32_t asset_handle,
+                                           struct tfm_sst_asset_attrs_t *attrs);
+
+/**
+ * \brief Sets asset's attributes referenced by asset handler.
+ *
+ * \param[in] app_id        Application ID
+ * \param[in] asset_handle  Asset handler
+ * \param[in] attrs         Pointer to new the asset's attributes
+ *                           \ref tfm_sst_asset_attrs_t
+ *
+ * \return Returns error code as specified in \ref tfm_sst_err_t
+ */
+enum tfm_sst_err_t tfm_sst_veneer_set_attributes(
+                                     uint32_t app_id,
+                                     uint32_t asset_handle,
+                                     const struct tfm_sst_asset_attrs_t *attrs);
+
+/**
  * \brief Reads asset's data from asset referenced by asset handler.
  *
  * \param[in]     app_id         Application ID
diff --git a/interface/src/tfm_sst_api.c b/interface/src/tfm_sst_api.c
index 99d9d38..1b9a8f2 100644
--- a/interface/src/tfm_sst_api.c
+++ b/interface/src/tfm_sst_api.c
@@ -36,6 +36,27 @@
                                     0);
 }
 
+enum tfm_sst_err_t tfm_sst_get_attributes(uint32_t asset_handle,
+                                          struct tfm_sst_asset_attrs_t *attrs)
+{
+    return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_GET_ATTRIBUTES,
+                                    asset_handle,
+                                    (uint32_t)attrs,
+                                    0,
+                                    0);
+}
+
+enum tfm_sst_err_t tfm_sst_set_attributes(
+                                      uint32_t asset_handle,
+                                      const struct tfm_sst_asset_attrs_t *attrs)
+{
+    return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_SET_ATTRIBUTES,
+                                    asset_handle,
+                                    (uint32_t)attrs,
+                                    0,
+                                    0);
+}
+
 enum tfm_sst_err_t tfm_sst_read(uint32_t asset_handle, struct tfm_sst_buf_t* data)
 {
     return tfm_ns_lock_svc_dispatch(SVC_TFM_SST_READ,
diff --git a/interface/src/tfm_sst_svc_handler.c b/interface/src/tfm_sst_svc_handler.c
index 31ca9bd..76c5c96 100644
--- a/interface/src/tfm_sst_svc_handler.c
+++ b/interface/src/tfm_sst_svc_handler.c
@@ -40,6 +40,28 @@
     return tfm_sst_veneer_get_info(app_id, asset_handle, info);
 }
 
+enum tfm_sst_err_t tfm_sst_svc_get_attributes(
+                                            uint32_t asset_handle,
+                                            struct tfm_sst_asset_attrs_t *attrs)
+{
+    uint32_t app_id;
+
+    app_id = tfm_sst_get_cur_id();
+
+    return tfm_sst_veneer_get_attributes(app_id, asset_handle, attrs);
+}
+
+enum tfm_sst_err_t tfm_sst_svc_set_attributes(
+                                      uint32_t asset_handle,
+                                      const struct tfm_sst_asset_attrs_t *attrs)
+{
+    uint32_t app_id;
+
+    app_id = tfm_sst_get_cur_id();
+
+    return tfm_sst_veneer_set_attributes(app_id, asset_handle, attrs);
+}
+
 enum tfm_sst_err_t tfm_sst_svc_read(uint32_t asset_handle,
                                     struct tfm_sst_buf_t* data)
 {