Rename libpsa to libpsats

Instead of using a generic name for the library, give it a TS specific
name to avoid possible naming collisions with other psa libraries in
the future.

Change-Id: Icea9be4d836f7d22300b20c8d6a5f8bd8fae1133
Signed-off-by: Gabor Toth <gabor.toth2@arm.com>
diff --git a/components/app/platform-inspect/attest_report_fetcher.cpp b/components/app/platform-inspect/attest_report_fetcher.cpp
index b99dc07..09871c1 100644
--- a/components/app/platform-inspect/attest_report_fetcher.cpp
+++ b/components/app/platform-inspect/attest_report_fetcher.cpp
@@ -11,7 +11,7 @@
 #include <t_cose/t_cose_sign1_verify.h>
 #include <vector>
 
-#include "libpsa.h"
+#include "libpsats.h"
 
 static bool fetch_iak_public_key(psa_key_id_t &iak_id, std::string &error_msg);
 static bool verify_token(std::vector<uint8_t> &report, const uint8_t *token, size_t token_len,
diff --git a/components/app/platform-inspect/platform_inspect.cpp b/components/app/platform-inspect/platform_inspect.cpp
index 903e6a6..ae1330b 100644
--- a/components/app/platform-inspect/platform_inspect.cpp
+++ b/components/app/platform-inspect/platform_inspect.cpp
@@ -11,7 +11,7 @@
 #include <vector>
 
 #include "attest_report_fetcher.h"
-#include "libpsa.h"
+#include "libpsats.h"
 
 int main(void)
 {
@@ -20,15 +20,15 @@
 	std::string error_msg;
 	std::vector<uint8_t> attest_report;
 
-	psa_status = libpsa_init_crypto_context("sn:trustedfirmware.org:crypto:0");
+	psa_status = libpsats_init_crypto_context("sn:trustedfirmware.org:crypto:0");
 	if (psa_status) {
-		printf("libpsa_init_crypto_context failed: %d\n", psa_status);
+		printf("libpsats_init_crypto_context failed: %d\n", psa_status);
 		goto cleanup;
 	}
 
-	psa_status = libpsa_init_attestation_context("sn:trustedfirmware.org:attestation:0");
+	psa_status = libpsats_init_attestation_context("sn:trustedfirmware.org:attestation:0");
 	if (psa_status) {
-		printf("libpsa_init_crypto_context failed: %d\n", psa_status);
+		printf("libpsats_init_crypto_context failed: %d\n", psa_status);
 		goto cleanup;
 	}
 
@@ -45,8 +45,8 @@
 		printf("%s\n", error_msg.c_str());
 
 cleanup:
-	libpsa_deinit_crypto_context();
-	libpsa_deinit_attestation_context();
+	libpsats_deinit_crypto_context();
+	libpsats_deinit_attestation_context();
 
 	return rval;
 }
diff --git a/components/common/libpsa/libpsa.h b/components/common/libpsa/libpsa.h
deleted file mode 100644
index e5a6fa0..0000000
--- a/components/common/libpsa/libpsa.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include "psa/crypto_types.h"
-#include "psa/initial_attestation.h"
-#include "psa/internal_trusted_storage.h"
-#include "psa/protected_storage.h"
-
-#ifndef LIBPSA_H
-#define LIBPSA_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * The functions may be exported as a public interface to
- * a shared library.
- */
-#ifdef EXPORT_PUBLIC_INTERFACE_LIBPSA
-#define LIBPSA_EXPORTED __attribute__((__visibility__("default")))
-#else
-#define LIBPSA_EXPORTED
-#endif
-
-LIBPSA_EXPORTED psa_status_t libpsa_init_crypto_context(const char *service_name);
-LIBPSA_EXPORTED void libpsa_deinit_crypto_context(void);
-
-LIBPSA_EXPORTED psa_status_t libpsa_init_attestation_context(const char *service_name);
-LIBPSA_EXPORTED void libpsa_deinit_attestation_context(void);
-
-LIBPSA_EXPORTED psa_status_t libpsa_init_its_context(const char *service_name);
-LIBPSA_EXPORTED void libpsa_deinit_its_context(void);
-
-LIBPSA_EXPORTED psa_status_t libpsa_init_ps_context(const char *service_name);
-LIBPSA_EXPORTED void libpsa_deinit_ps_context(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBPSA_H */
diff --git a/components/common/libpsa/component.cmake b/components/common/libpsats/component.cmake
similarity index 68%
rename from components/common/libpsa/component.cmake
rename to components/common/libpsats/component.cmake
index 08e4748..e1ea32d 100644
--- a/components/common/libpsa/component.cmake
+++ b/components/common/libpsats/component.cmake
@@ -9,8 +9,8 @@
 endif()
 
 target_sources(${TGT} PRIVATE
-	"${CMAKE_CURRENT_LIST_DIR}/libpsa-attestation.c"
-	"${CMAKE_CURRENT_LIST_DIR}/libpsa-crypto.c"
-	"${CMAKE_CURRENT_LIST_DIR}/libpsa-its.c"
-	"${CMAKE_CURRENT_LIST_DIR}/libpsa-ps.c"
+	"${CMAKE_CURRENT_LIST_DIR}/libpsats-attestation.c"
+	"${CMAKE_CURRENT_LIST_DIR}/libpsats-crypto.c"
+	"${CMAKE_CURRENT_LIST_DIR}/libpsats-its.c"
+	"${CMAKE_CURRENT_LIST_DIR}/libpsats-ps.c"
 	)
diff --git a/components/common/libpsa/libpsa-attestation.c b/components/common/libpsats/libpsats-attestation.c
similarity index 88%
rename from components/common/libpsa/libpsa-attestation.c
rename to components/common/libpsats/libpsats-attestation.c
index 9e795a6..c67422b 100644
--- a/components/common/libpsa/libpsa-attestation.c
+++ b/components/common/libpsats/libpsats-attestation.c
@@ -11,13 +11,13 @@
 #include <service_locator.h>
 #include <stdio.h>
 
-#include "libpsa.h"
+#include "libpsats.h"
 #include "trace.h"
 
 static struct rpc_caller_session *rpc_session;
 static struct service_context *attestation_service_context;
 
-LIBPSA_EXPORTED psa_status_t libpsa_init_attestation_context(const char *service_name)
+LIBPSATS_EXPORTED psa_status_t libpsats_init_attestation_context(const char *service_name)
 {
 	psa_status_t result = PSA_ERROR_GENERIC_ERROR;
 	psa_status_t provision_result = PSA_ERROR_GENERIC_ERROR;
@@ -40,7 +40,7 @@
 
 	if (!rpc_session) {
 		EMSG("Failed to open rpc session\n");
-		libpsa_deinit_attestation_context();
+		libpsats_deinit_attestation_context();
 		return result;
 	}
 
@@ -61,7 +61,7 @@
 	return result;
 }
 
-LIBPSA_EXPORTED void libpsa_deinit_attestation_context(void)
+LIBPSATS_EXPORTED void libpsats_deinit_attestation_context(void)
 {
 	psa_iat_client_deinit();
 	attest_provision_client_deinit();
diff --git a/components/common/libpsa/libpsa-crypto.c b/components/common/libpsats/libpsats-crypto.c
similarity index 86%
rename from components/common/libpsa/libpsa-crypto.c
rename to components/common/libpsats/libpsats-crypto.c
index 4a3a10e..cb4b6f0 100644
--- a/components/common/libpsa/libpsa-crypto.c
+++ b/components/common/libpsats/libpsats-crypto.c
@@ -9,13 +9,13 @@
 #include <service_locator.h>
 #include <stdio.h>
 
-#include "libpsa.h"
+#include "libpsats.h"
 #include "trace.h"
 
 static struct rpc_caller_session *rpc_session;
 static struct service_context *crypto_service_context;
 
-LIBPSA_EXPORTED psa_status_t libpsa_init_crypto_context(const char *service_name)
+LIBPSATS_EXPORTED psa_status_t libpsats_init_crypto_context(const char *service_name)
 {
 	psa_status_t result = PSA_ERROR_GENERIC_ERROR;
 
@@ -37,7 +37,7 @@
 
 	if (!rpc_session) {
 		EMSG("Failed to open rpc session\n");
-		libpsa_deinit_crypto_context();
+		libpsats_deinit_crypto_context();
 		return result;
 	}
 
@@ -49,7 +49,7 @@
 	return result;
 }
 
-LIBPSA_EXPORTED void libpsa_deinit_crypto_context(void)
+LIBPSATS_EXPORTED void libpsats_deinit_crypto_context(void)
 {
 	psa_crypto_client_deinit();
 
diff --git a/components/common/libpsa/libpsa-its.c b/components/common/libpsats/libpsats-its.c
similarity index 87%
rename from components/common/libpsa/libpsa-its.c
rename to components/common/libpsats/libpsats-its.c
index 3915bfc..db98c1d 100644
--- a/components/common/libpsa/libpsa-its.c
+++ b/components/common/libpsats/libpsats-its.c
@@ -10,14 +10,14 @@
 #include <service_locator.h>
 #include <stdio.h>
 
-#include "libpsa.h"
+#include "libpsats.h"
 #include "trace.h"
 
 static struct rpc_caller_session *rpc_session;
 static struct service_context *its_service_context;
 static struct secure_storage_client its_storage_client;
 
-LIBPSA_EXPORTED psa_status_t libpsa_init_its_context(const char *service_name)
+LIBPSATS_EXPORTED psa_status_t libpsats_init_its_context(const char *service_name)
 {
 	psa_status_t result = PSA_ERROR_GENERIC_ERROR;
 
@@ -39,7 +39,7 @@
 
 	if (!rpc_session) {
 		EMSG("Failed to open rpc session\n");
-		libpsa_deinit_its_context();
+		libpsats_deinit_its_context();
 		return result;
 	}
 
@@ -48,7 +48,7 @@
 
 	if (!its_storage_backend) {
 		EMSG("Failed to initialize storage backend\n");
-		libpsa_deinit_its_context();
+		libpsats_deinit_its_context();
 		return result;
 	}
 
@@ -57,7 +57,7 @@
 	return result;
 }
 
-LIBPSA_EXPORTED void libpsa_deinit_its_context(void)
+LIBPSATS_EXPORTED void libpsats_deinit_its_context(void)
 {
 	psa_its_frontend_init(NULL);
 	secure_storage_client_deinit(&its_storage_client);
diff --git a/components/common/libpsa/libpsa-ps.c b/components/common/libpsats/libpsats-ps.c
similarity index 87%
rename from components/common/libpsa/libpsa-ps.c
rename to components/common/libpsats/libpsats-ps.c
index 01d41d1..a776460 100644
--- a/components/common/libpsa/libpsa-ps.c
+++ b/components/common/libpsats/libpsats-ps.c
@@ -10,14 +10,14 @@
 #include <service_locator.h>
 #include <stdio.h>
 
-#include "libpsa.h"
+#include "libpsats.h"
 #include "trace.h"
 
 static struct rpc_caller_session *rpc_session;
 static struct service_context *ps_service_context;
 static struct secure_storage_client ps_storage_client;
 
-LIBPSA_EXPORTED psa_status_t libpsa_init_ps_context(const char *service_name)
+LIBPSATS_EXPORTED psa_status_t libpsats_init_ps_context(const char *service_name)
 {
 	psa_status_t result = PSA_ERROR_GENERIC_ERROR;
 
@@ -39,7 +39,7 @@
 
 	if (!rpc_session) {
 		EMSG("Failed to open rpc session\n");
-		libpsa_deinit_ps_context();
+		libpsats_deinit_ps_context();
 		return result;
 	}
 
@@ -48,7 +48,7 @@
 
 	if (!ps_storage_backend) {
 		EMSG("Failed to initialize storage backend\n");
-		libpsa_deinit_ps_context();
+		libpsats_deinit_ps_context();
 		return result;
 	}
 
@@ -57,7 +57,7 @@
 	return result;
 }
 
-LIBPSA_EXPORTED void libpsa_deinit_ps_context(void)
+LIBPSATS_EXPORTED void libpsats_deinit_ps_context(void)
 {
 	psa_ps_frontend_init(NULL);
 	secure_storage_client_deinit(&ps_storage_client);
diff --git a/components/common/libpsats/libpsats.h b/components/common/libpsats/libpsats.h
new file mode 100644
index 0000000..b4ca9ca
--- /dev/null
+++ b/components/common/libpsats/libpsats.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include "psa/crypto_types.h"
+#include "psa/initial_attestation.h"
+#include "psa/internal_trusted_storage.h"
+#include "psa/protected_storage.h"
+
+#ifndef LIBPSATS_H
+#define LIBPSATS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The functions may be exported as a public interface to
+ * a shared library.
+ */
+#ifdef EXPORT_PUBLIC_INTERFACE_LIBPSATS
+#define LIBPSATS_EXPORTED __attribute__((__visibility__("default")))
+#else
+#define LIBPSATS_EXPORTED
+#endif
+
+LIBPSATS_EXPORTED psa_status_t libpsats_init_crypto_context(const char *service_name);
+LIBPSATS_EXPORTED void libpsats_deinit_crypto_context(void);
+
+LIBPSATS_EXPORTED psa_status_t libpsats_init_attestation_context(const char *service_name);
+LIBPSATS_EXPORTED void libpsats_deinit_attestation_context(void);
+
+LIBPSATS_EXPORTED psa_status_t libpsats_init_its_context(const char *service_name);
+LIBPSATS_EXPORTED void libpsats_deinit_its_context(void);
+
+LIBPSATS_EXPORTED psa_status_t libpsats_init_ps_context(const char *service_name);
+LIBPSATS_EXPORTED void libpsats_deinit_ps_context(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* LIBPSATS_H */
diff --git a/deployments/libpsa/libpsa-import.cmake b/deployments/libpsa/libpsa-import.cmake
deleted file mode 100644
index 661b40d..0000000
--- a/deployments/libpsa/libpsa-import.cmake
+++ /dev/null
@@ -1,114 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-#
-#-------------------------------------------------------------------------------
-
-#-------------------------------------------------------------------------------
-# Import libpsa into a dependent in-tree deployment build.  Where another
-# deployment uses libpsa, including this file in the dependent deployment
-# CMake build file allows libpsa to be built and installed into the binary
-# directory of the dependent.
-#-------------------------------------------------------------------------------
-option(CFG_FORCE_PREBUILT_LIBPSA Off)
-# Try to find a pre-build package.
-version_semver_read(FILE "${CMAKE_CURRENT_LIST_DIR}/version.txt" MAJOR _major MINOR _minor PATCH _patch)
-set(_verstring "${_major}.${_minor}.${_patch}")
-
-if (COVERAGE)
-	set(LIBPSA_BUILD_TYPE "DebugCoverage" CACHE STRING "Build type." FORCE)
-endif()
-
-find_package(libpsa "${_verstring}" QUIET PATHS ${CMAKE_CURRENT_BINARY_DIR}/libpsa_install/${TS_ENV}/lib/cmake/libpsa)
-if(NOT libpsa_FOUND)
-	if (CFG_FORCE_PREBUILT_LIBPSA)
-		string(CONCAT _msg "find_package() failed to find the \"libpsa\" package. Please pass -Dlibpsa_ROOT=<full path>"
-							" to cmake, where <full path> is the directory of the libpsaConfig.cmake file, or "
-							" pass -DCMAKE_FIND_ROOT_PATH=<path>, where <path> is the INSTALL_PREFIX used"
-							" when building libpsa. libpsa_ROOT can be set in the environment too."
-						   "If you wish to debug the search process pass -DCMAKE_FIND_DEBUG_MODE=ON to cmake.")
-		message(FATAL_ERROR ${_msg})
-	endif()
-	# Set build type, if a specific value is required. This leaves the default value in the hands of the
-	# libpsa deployment being built.
-	if (DEFINED LIBPSA_BUILD_TYPE)
-		set(_libpsa_build_type_arg "-DCMAKE_BUILD_TYPE=${LIBPSA_BUILD_TYPE}")
-	endif()
-
-	# If not successful, build libpsa as a sub-project.
-	execute_process(COMMAND
-		${CMAKE_COMMAND} -E env "CROSS_COMPILE=${CROSS_COMPILE}"
-		${CMAKE_COMMAND}
-			${_libpsa_build_type_arg}
-			-S ${TS_ROOT}/deployments/libpsa/${TS_ENV}
-			-B ${CMAKE_CURRENT_BINARY_DIR}/libpsa
-		RESULT_VARIABLE
-			_exec_error
-		)
-	unset(_libpsa_build_type_arg)
-	if (NOT _exec_error EQUAL 0)
-		message(FATAL_ERROR "Configuring libpsa failed. ${_exec_error}")
-	endif()
-	execute_process(COMMAND
-		${CMAKE_COMMAND} -E env "CROSS_COMPILE=${CROSS_COMPILE}"
-		${CMAKE_COMMAND}
-			--build ${CMAKE_CURRENT_BINARY_DIR}/libpsa
-			--parallel ${PROCESSOR_COUNT}
-		RESULT_VARIABLE
-			_exec_error
-		)
-	if (NOT _exec_error EQUAL 0)
-		message(FATAL_ERROR "Installing libpsa failed. ${_exec_error}")
-	endif()
-	execute_process(COMMAND
-		${CMAKE_COMMAND} -E env "CROSS_COMPILE=${CROSS_COMPILE}"
-		${CMAKE_COMMAND}
-			--install ${CMAKE_CURRENT_BINARY_DIR}/libpsa
-			--prefix ${CMAKE_CURRENT_BINARY_DIR}/libpsa_install
-		RESULT_VARIABLE
-			_exec_error
-		)
-	if (NOT _exec_error EQUAL 0)
-		message(FATAL_ERROR "Installing libpsa failed. ${_exec_error}")
-	endif()
-
-	install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/libpsa/cmake_install.cmake)
-
-	find_package(libpsa "${_verstring}" QUIET REQUIRED PATHS ${CMAKE_CURRENT_BINARY_DIR}/libpsa_install/${TS_ENV}/lib/cmake/libpsa)
-else()
-	message(STATUS "Using prebuilt libpsa from ${libpsa_DIR}")
-endif()
-
-# Cmake will use the same build type of the imported target as used by the main project. If no mapping is configured and
-# the matching build type is not found, cmake will fall back to any build type. Details of the fall back mechanism are not
-# documented.
-# If a mapping is defined, and the imported target does not define the mapped build type, cmake will treat the library
-# as not found.
-#
-# If LIBPSA_BUILD_TYPE is set and the main project wants to use a specific build type, configure build type mapping to
-# only allow using the requested build type.
-if (DEFINED LIBPSA_BUILD_TYPE)
-	set_target_properties(libpsa::psa PROPERTIES
-		MAP_IMPORTED_CONFIG_DEBUG				${LIBPSA_BUILD_TYPE}
-		MAP_IMPORTED_CONFIG_MINSIZEREL			${LIBPSA_BUILD_TYPE}
-		MAP_IMPORTED_CONFIG_MINSIZWITHDEBINFO	${LIBPSA_BUILD_TYPE}
-		MAP_IMPORTED_CONFIG_RELEASE				${LIBPSA_BUILD_TYPE}
-		MAP_IMPORTED_CONFIG_RELWITHDEBINFO		${LIBPSA_BUILD_TYPE}
-		MAP_IMPORTED_CONFIG_DEBUGCOVERAGE		${LIBPSA_BUILD_TYPE}
-	)
-
-	# Do a manual check and issue a better message than the default one.
-	get_property(_libpsa_build_type TARGET libpsa::psa PROPERTY IMPORTED_CONFIGURATIONS)
-	string(TOUPPER ${LIBPSA_BUILD_TYPE} _uc_libpsa_build_type)
-	if(${_uc_libpsa_build_type} IN_LIST _libpsa_build_type)
-	else()
-		message(FATAL_ERROR "Installed libpsa package does not supports required build type ${LIBPSA_BUILD_TYPE}.")
-	endif()
-	unset(_libpsa_build_type)
-	unset(_uc_libpsa_build_type)
-endif()
-
-# libpsa can not be used without libts, so add the needed dependency.
-include(${TS_ROOT}/deployments/libts/libts-import.cmake)
-target_link_libraries(libpsa::psa INTERFACE libts::ts)
diff --git a/deployments/libpsa/arm-linux/CMakeLists.txt b/deployments/libpsats/arm-linux/CMakeLists.txt
similarity index 81%
rename from deployments/libpsa/arm-linux/CMakeLists.txt
rename to deployments/libpsats/arm-linux/CMakeLists.txt
index 5fb9f4a..20e4f1b 100644
--- a/deployments/libpsa/arm-linux/CMakeLists.txt
+++ b/deployments/libpsats/arm-linux/CMakeLists.txt
@@ -16,29 +16,29 @@
 endif()
 
 #-------------------------------------------------------------------------------
-#  The CMakeLists.txt for building the libpsa deployment for arm-linux
+#  The CMakeLists.txt for building the libpsats deployment for arm-linux
 #
-#  Used for building the libpsa library for the arm-linux environment. Used for
+#  Used for building the libpsats library for the arm-linux environment. Used for
 #  locating and accessing services from a Linux userspace client. Service
 #  instances can be located in any supported secure processing environment.
 #-------------------------------------------------------------------------------
 include(${TS_ROOT}/environments/arm-linux/env_shared_lib.cmake)
-project(psa LANGUAGES CXX C)
+project(psats LANGUAGES CXX C)
 
-add_library(psa)
+add_library(psats)
 
-target_include_directories(psa PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
+target_include_directories(psats PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
 
 #-------------------------------------------------------------------------------
 #  For user-specific tracing set to TRACE_LEVEL_NONE and implement:
 #  void trace_puts(const char *str)
 #-------------------------------------------------------------------------------
 
-set(TRACE_PREFIX "LIBPSA" CACHE STRING "Trace prefix")
+set(TRACE_PREFIX "LIBPSATS" CACHE STRING "Trace prefix")
 set(TRACE_LEVEL "TRACE_LEVEL_DEBUG" CACHE STRING "Trace level")
 #-------------------------------------------------------------------------------
 #  Extend with components that are common across all deployments of
-#  libpsa
+#  libpsats
 #
 #-------------------------------------------------------------------------------
-include(../libpsa.cmake REQUIRED)
+include(../libpsats.cmake REQUIRED)
diff --git a/deployments/libpsats/libpsats-import.cmake b/deployments/libpsats/libpsats-import.cmake
new file mode 100644
index 0000000..9c44ca7
--- /dev/null
+++ b/deployments/libpsats/libpsats-import.cmake
@@ -0,0 +1,114 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+# Import libpsats into a dependent in-tree deployment build.  Where another
+# deployment uses libpsats, including this file in the dependent deployment
+# CMake build file allows libpsats to be built and installed into the binary
+# directory of the dependent.
+#-------------------------------------------------------------------------------
+option(CFG_FORCE_PREBUILT_LIBPSATS Off)
+# Try to find a pre-build package.
+version_semver_read(FILE "${CMAKE_CURRENT_LIST_DIR}/version.txt" MAJOR _major MINOR _minor PATCH _patch)
+set(_verstring "${_major}.${_minor}.${_patch}")
+
+if (COVERAGE)
+	set(LIBPSATS_BUILD_TYPE "DebugCoverage" CACHE STRING "Build type." FORCE)
+endif()
+
+find_package(libpsats "${_verstring}" QUIET PATHS ${CMAKE_CURRENT_BINARY_DIR}/libpsats_install/${TS_ENV}/lib/cmake/libpsats)
+if(NOT libpsats_FOUND)
+	if (CFG_FORCE_PREBUILT_LIBPSATS)
+		string(CONCAT _msg "find_package() failed to find the \"libpsats\" package. Please pass -Dlibpsats_ROOT=<full path>"
+							" to cmake, where <full path> is the directory of the libpsatsConfig.cmake file, or "
+							" pass -DCMAKE_FIND_ROOT_PATH=<path>, where <path> is the INSTALL_PREFIX used"
+							" when building libpsats. libpsats_ROOT can be set in the environment too."
+						   "If you wish to debug the search process pass -DCMAKE_FIND_DEBUG_MODE=ON to cmake.")
+		message(FATAL_ERROR ${_msg})
+	endif()
+	# Set build type, if a specific value is required. This leaves the default value in the hands of the
+	# libpsats deployment being built.
+	if (DEFINED LIBPSATS_BUILD_TYPE)
+		set(_libpsats_build_type_arg "-DCMAKE_BUILD_TYPE=${LIBPSATS_BUILD_TYPE}")
+	endif()
+
+	# If not successful, build libpsats as a sub-project.
+	execute_process(COMMAND
+		${CMAKE_COMMAND} -E env "CROSS_COMPILE=${CROSS_COMPILE}"
+		${CMAKE_COMMAND}
+			${_libpsats_build_type_arg}
+			-S ${TS_ROOT}/deployments/libpsats/${TS_ENV}
+			-B ${CMAKE_CURRENT_BINARY_DIR}/libpsats
+		RESULT_VARIABLE
+			_exec_error
+		)
+	unset(_libpsats_build_type_arg)
+	if (NOT _exec_error EQUAL 0)
+		message(FATAL_ERROR "Configuring libpsats failed. ${_exec_error}")
+	endif()
+	execute_process(COMMAND
+		${CMAKE_COMMAND} -E env "CROSS_COMPILE=${CROSS_COMPILE}"
+		${CMAKE_COMMAND}
+			--build ${CMAKE_CURRENT_BINARY_DIR}/libpsats
+			--parallel ${PROCESSOR_COUNT}
+		RESULT_VARIABLE
+			_exec_error
+		)
+	if (NOT _exec_error EQUAL 0)
+		message(FATAL_ERROR "Installing libpsats failed. ${_exec_error}")
+	endif()
+	execute_process(COMMAND
+		${CMAKE_COMMAND} -E env "CROSS_COMPILE=${CROSS_COMPILE}"
+		${CMAKE_COMMAND}
+			--install ${CMAKE_CURRENT_BINARY_DIR}/libpsats
+			--prefix ${CMAKE_CURRENT_BINARY_DIR}/libpsats_install
+		RESULT_VARIABLE
+			_exec_error
+		)
+	if (NOT _exec_error EQUAL 0)
+		message(FATAL_ERROR "Installing libpsats failed. ${_exec_error}")
+	endif()
+
+	install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/libpsats/cmake_install.cmake)
+
+	find_package(libpsats "${_verstring}" QUIET REQUIRED PATHS ${CMAKE_CURRENT_BINARY_DIR}/libpsats_install/${TS_ENV}/lib/cmake/libpsats)
+else()
+	message(STATUS "Using prebuilt libpsats from ${libpsats_DIR}")
+endif()
+
+# Cmake will use the same build type of the imported target as used by the main project. If no mapping is configured and
+# the matching build type is not found, cmake will fall back to any build type. Details of the fall back mechanism are not
+# documented.
+# If a mapping is defined, and the imported target does not define the mapped build type, cmake will treat the library
+# as not found.
+#
+# If LIBPSATS_BUILD_TYPE is set and the main project wants to use a specific build type, configure build type mapping to
+# only allow using the requested build type.
+if (DEFINED LIBPSATS_BUILD_TYPE)
+	set_target_properties(libpsats::psats PROPERTIES
+		MAP_IMPORTED_CONFIG_DEBUG				${LIBPSATS_BUILD_TYPE}
+		MAP_IMPORTED_CONFIG_MINSIZEREL			${LIBPSATS_BUILD_TYPE}
+		MAP_IMPORTED_CONFIG_MINSIZWITHDEBINFO	${LIBPSATS_BUILD_TYPE}
+		MAP_IMPORTED_CONFIG_RELEASE				${LIBPSATS_BUILD_TYPE}
+		MAP_IMPORTED_CONFIG_RELWITHDEBINFO		${LIBPSATS_BUILD_TYPE}
+		MAP_IMPORTED_CONFIG_DEBUGCOVERAGE		${LIBPSATS_BUILD_TYPE}
+	)
+
+	# Do a manual check and issue a better message than the default one.
+	get_property(_libpsats_build_type TARGET libpsats::psats PROPERTY IMPORTED_CONFIGURATIONS)
+	string(TOUPPER ${LIBPSATS_BUILD_TYPE} _uc_libpsats_build_type)
+	if(${_uc_libpsats_build_type} IN_LIST _libpsats_build_type)
+	else()
+		message(FATAL_ERROR "Installed libpsats package does not supports required build type ${LIBPSATS_BUILD_TYPE}.")
+	endif()
+	unset(_libpsats_build_type)
+	unset(_uc_libpsats_build_type)
+endif()
+
+# libpsats can not be used without libts, so add the needed dependency.
+include(${TS_ROOT}/deployments/libts/libts-import.cmake)
+target_link_libraries(libpsats::psats INTERFACE libts::ts)
diff --git a/deployments/libpsa/libpsa.cmake b/deployments/libpsats/libpsats.cmake
similarity index 80%
rename from deployments/libpsa/libpsa.cmake
rename to deployments/libpsats/libpsats.cmake
index d5ca8e5..9ce0039 100644
--- a/deployments/libpsa/libpsa.cmake
+++ b/deployments/libpsats/libpsats.cmake
@@ -6,27 +6,27 @@
 #-------------------------------------------------------------------------------
 
 #-------------------------------------------------------------------------------
-#  The base build file shared between deployments of 'libpsa' for different
-#  environments.  libpsa provides an interface for accessing PSA API-s.
+#  The base build file shared between deployments of 'libpsats' for different
+#  environments.  libpsats provides an interface for accessing PSA API-s.
 #  Building with each build type results in different postfix for the library.
 #  For details, please refer to deployment.cmake.
 #-------------------------------------------------------------------------------
 
 #-------------------------------------------------------------------------------
-#  Common API version implemented by all libpsa deployments
+#  Common API version implemented by all libpsats deployments
 #-------------------------------------------------------------------------------
 version_semver_read(FILE "${CMAKE_CURRENT_LIST_DIR}/version.txt"
 					MAJOR _major MINOR _minor PATCH _patch)
-set_target_properties(psa PROPERTIES VERSION "${_major}.${_minor}.${_patch}")
-set_target_properties(psa PROPERTIES SOVERSION "${_major}")
+set_target_properties(psats PROPERTIES VERSION "${_major}.${_minor}.${_patch}")
+set_target_properties(psats PROPERTIES SOVERSION "${_major}")
 unset(_major)
 unset(_minor)
 unset(_patch)
 
-add_library(libpsa::psa ALIAS psa)
+add_library(libpsats::psats ALIAS psats)
 
 if (COVERAGE)
-	set(LIBPSA_BUILD_TYPE "DebugCoverage" CACHE STRING "Build type." FORCE)
+	set(LIBPSATS_BUILD_TYPE "DebugCoverage" CACHE STRING "Build type." FORCE)
 endif()
 
 #-------------------------------------------------------------------------------
@@ -35,7 +35,7 @@
 #  deployed.
 #-------------------------------------------------------------------------------
 include(${TS_ROOT}/deployments/libts/libts-import.cmake)
-target_link_libraries(psa PUBLIC libts::ts)
+target_link_libraries(psats PUBLIC libts::ts)
 
 #-------------------------------------------------------------------------------
 #  Components that are common across all deployments
@@ -43,13 +43,13 @@
 #-------------------------------------------------------------------------------
 
 add_components(
-	TARGET "psa"
+	TARGET "psats"
 	BASE_DIR ${TS_ROOT}
 	COMPONENTS
 		"environments/${TS_ENV}"
 		"components/common/utils"
 		"components/common/trace"
-		"components/common/libpsa"
+		"components/common/libpsats"
 		"components/common/tlv"
 		"components/service/common/include"
 		"components/service/common/client"
@@ -70,8 +70,8 @@
 #-------------------------------------------------------------------------------
 
 # Enable exporting interface symbols for library public interface
-target_compile_definitions(psa PRIVATE
-	EXPORT_PUBLIC_INTERFACE_LIBPSA
+target_compile_definitions(psats PRIVATE
+	EXPORT_PUBLIC_INTERFACE_LIBPSATS
 	EXPORT_PUBLIC_INTERFACE_PSA_CRYPTO
 	EXPORT_PUBLIC_INTERFACE_PSA_ATTEST
 	EXPORT_PUBLIC_INTERFACE_PSA_ITS
@@ -86,9 +86,9 @@
 
 # Exports library information in preparation for install
 export_library(
-	TARGET "psa"
-	LIB_NAME "libpsa"
-	PKG_CONFIG_FILE "${CMAKE_CURRENT_LIST_DIR}/libpsaConfig.cmake.in"
+	TARGET "psats"
+	LIB_NAME "libpsats"
+	PKG_CONFIG_FILE "${CMAKE_CURRENT_LIST_DIR}/libpsatsConfig.cmake.in"
 )
 
 install(DIRECTORY "${TS_ROOT}/components/service/crypto/include"
@@ -102,6 +102,6 @@
 		DESTINATION ${TS_ENV}/include/psa
 )
 
-install(FILES "${TS_ROOT}/components/common/libpsa/libpsa.h"
+install(FILES "${TS_ROOT}/components/common/libpsats/libpsats.h"
 		DESTINATION ${TS_ENV}/include
 )
diff --git a/deployments/libpsa/libpsaConfig.cmake.in b/deployments/libpsats/libpsatsConfig.cmake.in
similarity index 69%
rename from deployments/libpsa/libpsaConfig.cmake.in
rename to deployments/libpsats/libpsatsConfig.cmake.in
index 710411b..f23ed8d 100644
--- a/deployments/libpsa/libpsaConfig.cmake.in
+++ b/deployments/libpsats/libpsatsConfig.cmake.in
@@ -6,4 +6,4 @@
 
 @PACKAGE_INIT@
 
-include("${CMAKE_CURRENT_LIST_DIR}/libpsaTargets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/libpsatsTargets.cmake")
diff --git a/deployments/libpsa/linux-pc/CMakeLists.txt b/deployments/libpsats/linux-pc/CMakeLists.txt
similarity index 81%
rename from deployments/libpsa/linux-pc/CMakeLists.txt
rename to deployments/libpsats/linux-pc/CMakeLists.txt
index 7d45a36..1d3696b 100644
--- a/deployments/libpsa/linux-pc/CMakeLists.txt
+++ b/deployments/libpsats/linux-pc/CMakeLists.txt
@@ -16,29 +16,29 @@
 endif()
 
 #-------------------------------------------------------------------------------
-#  The CMakeLists.txt for building the libpsa deployment for arm-linux
+#  The CMakeLists.txt for building the libpsats deployment for arm-linux
 #
-#  Used for building the libpsa library for the arm-linux environment. Used for
+#  Used for building the libpsats library for the arm-linux environment. Used for
 #  locating and accessing services from a Linux userspace client. Service
 #  instances can be located in any supported secure processing environment.
 #-------------------------------------------------------------------------------
 include(${TS_ROOT}/environments/linux-pc/env_shared_lib.cmake)
-project(psa LANGUAGES CXX C)
+project(psats LANGUAGES CXX C)
 
-add_library(psa)
+add_library(psats)
 
-target_include_directories(psa PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
+target_include_directories(psats PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
 
 #-------------------------------------------------------------------------------
 #  For user-specific tracing set to TRACE_LEVEL_NONE and implement:
 #  void trace_puts(const char *str)
 #-------------------------------------------------------------------------------
 
-set(TRACE_PREFIX "LIBPSA" CACHE STRING "Trace prefix")
+set(TRACE_PREFIX "LIBPSATS" CACHE STRING "Trace prefix")
 set(TRACE_LEVEL "TRACE_LEVEL_DEBUG" CACHE STRING "Trace level")
 #-------------------------------------------------------------------------------
 #  Extend with components that are common across all deployments of
-#  libpsa
+#  libpsats
 #
 #-------------------------------------------------------------------------------
-include(../libpsa.cmake REQUIRED)
+include(../libpsats.cmake REQUIRED)
diff --git a/deployments/libpsa/version.txt b/deployments/libpsats/version.txt
similarity index 100%
rename from deployments/libpsa/version.txt
rename to deployments/libpsats/version.txt
diff --git a/deployments/platform-inspect/platform-inspect.cmake b/deployments/platform-inspect/platform-inspect.cmake
index b31f39f..d9f1ca7 100644
--- a/deployments/platform-inspect/platform-inspect.cmake
+++ b/deployments/platform-inspect/platform-inspect.cmake
@@ -11,16 +11,16 @@
 #-------------------------------------------------------------------------------
 
 #-------------------------------------------------------------------------------
-#  Use libpsa for locating PSA services. An appropriate version of
-#  libpsa will be imported for the environment.
+#  Use libpsats for locating PSA services. An appropriate version of
+#  libpsats will be imported for the environment.
 #-------------------------------------------------------------------------------
 if (COVERAGE)
-	set(LIBPSA_BUILD_TYPE "DEBUGCOVERAGE" CACHE STRING "Libpsa build type" FORCE)
+	set(LIBPSATS_BUILD_TYPE "DEBUGCOVERAGE" CACHE STRING "Libpsats build type" FORCE)
 	set(LIBTS_BUILD_TYPE "DEBUGCOVERAGE" CACHE STRING "Libts build type" FORCE)
 endif()
 
-include(${TS_ROOT}/deployments/libpsa/libpsa-import.cmake)
-target_link_libraries(platform-inspect PRIVATE libpsa::psa)
+include(${TS_ROOT}/deployments/libpsats/libpsats-import.cmake)
+target_link_libraries(platform-inspect PRIVATE libpsats::psats)
 
 #-------------------------------------------------------------------------------
 #  Components that are common across all deployments
diff --git a/deployments/psa-api-test/crypto/crypto.c b/deployments/psa-api-test/crypto/crypto.c
index 9cbc67b..612012d 100644
--- a/deployments/psa-api-test/crypto/crypto.c
+++ b/deployments/psa-api-test/crypto/crypto.c
@@ -5,7 +5,7 @@
  */
 
 #include "../psa_api_test_common.h"
-#include "libpsa.h"
+#include "libpsats.h"
 #include "trace.h"
 
 psa_status_t test_setup(const char *service_name_crypto, const char *service_name_iat,
@@ -16,9 +16,9 @@
 	if (!service_name_crypto)
 		service_name_crypto = "sn:trustedfirmware.org:crypto:0";
 
-	psa_status = libpsa_init_crypto_context(service_name_crypto);
+	psa_status = libpsats_init_crypto_context(service_name_crypto);
 	if (psa_status) {
-		EMSG("libpsa_init_crypto_context failed: %d\n", psa_status);
+		EMSG("libpsats_init_crypto_context failed: %d\n", psa_status);
 		return psa_status;
 	}
 
@@ -33,5 +33,5 @@
 
 void test_teardown(void)
 {
-	libpsa_deinit_crypto_context();
+	libpsats_deinit_crypto_context();
 }
diff --git a/deployments/psa-api-test/initial_attestation/iat.c b/deployments/psa-api-test/initial_attestation/iat.c
index eb03dc7..438bb58 100644
--- a/deployments/psa-api-test/initial_attestation/iat.c
+++ b/deployments/psa-api-test/initial_attestation/iat.c
@@ -5,7 +5,7 @@
  */
 
 #include "../psa_api_test_common.h"
-#include "libpsa.h"
+#include "libpsats.h"
 #include "trace.h"
 
 psa_status_t test_setup(const char *service_name_crypto, const char *service_name_iat,
@@ -19,15 +19,15 @@
 	if (!service_name_iat)
 		service_name_iat = "sn:trustedfirmware.org:attestation:0";
 
-	psa_status = libpsa_init_crypto_context(service_name_crypto);
+	psa_status = libpsats_init_crypto_context(service_name_crypto);
 	if (psa_status) {
-		EMSG("libpsa_init_crypto_context failed: %d\n", psa_status);
+		EMSG("libpsats_init_crypto_context failed: %d\n", psa_status);
 		return psa_status;
 	}
 
-	psa_status = libpsa_init_attestation_context(service_name_iat);
+	psa_status = libpsats_init_attestation_context(service_name_iat);
 	if (psa_status) {
-		EMSG("libpsa_init_attestation_context failed: %d\n", psa_status);
+		EMSG("libpsats_init_attestation_context failed: %d\n", psa_status);
 		return psa_status;
 	}
 
@@ -42,6 +42,6 @@
 
 void test_teardown(void)
 {
-	libpsa_deinit_crypto_context();
-	libpsa_deinit_attestation_context();
+	libpsats_deinit_crypto_context();
+	libpsats_deinit_attestation_context();
 }
diff --git a/deployments/psa-api-test/internal_trusted_storage/its.c b/deployments/psa-api-test/internal_trusted_storage/its.c
index 9f3860b..38b3d58 100644
--- a/deployments/psa-api-test/internal_trusted_storage/its.c
+++ b/deployments/psa-api-test/internal_trusted_storage/its.c
@@ -5,7 +5,7 @@
  */
 
 #include "../psa_api_test_common.h"
-#include "libpsa.h"
+#include "libpsats.h"
 #include "trace.h"
 
 psa_status_t test_setup(const char *service_name_crypto, const char *service_name_iat,
@@ -16,9 +16,9 @@
 	if (!service_name_its)
 		service_name_its = "sn:trustedfirmware.org:internal-trusted-storage:0";
 
-	psa_status = libpsa_init_its_context(service_name_its);
+	psa_status = libpsats_init_its_context(service_name_its);
 	if (psa_status) {
-		EMSG("libpsa_init_its_context failed: %d\n", psa_status);
+		EMSG("libpsats_init_its_context failed: %d\n", psa_status);
 		return psa_status;
 	}
 
@@ -27,5 +27,5 @@
 
 void test_teardown(void)
 {
-	libpsa_deinit_its_context();
+	libpsats_deinit_its_context();
 }
diff --git a/deployments/psa-api-test/protected_storage/ps.c b/deployments/psa-api-test/protected_storage/ps.c
index c20a860..2f0a800 100644
--- a/deployments/psa-api-test/protected_storage/ps.c
+++ b/deployments/psa-api-test/protected_storage/ps.c
@@ -5,7 +5,7 @@
  */
 
 #include "../psa_api_test_common.h"
-#include "libpsa.h"
+#include "libpsats.h"
 #include "trace.h"
 
 psa_status_t test_setup(const char *service_name_crypto, const char *service_name_iat,
@@ -16,9 +16,9 @@
 	if (!service_name_ps)
 		service_name_ps = "sn:trustedfirmware.org:protected-storage:0";
 
-	psa_status = libpsa_init_ps_context(service_name_ps);
+	psa_status = libpsats_init_ps_context(service_name_ps);
 	if (psa_status) {
-		EMSG("libpsa_init_ps_context failed: %d\n", psa_status);
+		EMSG("libpsats_init_ps_context failed: %d\n", psa_status);
 		return psa_status;
 	}
 
@@ -27,5 +27,5 @@
 
 void test_teardown(void)
 {
-	libpsa_deinit_ps_context();
+	libpsats_deinit_ps_context();
 }
diff --git a/deployments/psa-api-test/psa-api-test.cmake b/deployments/psa-api-test/psa-api-test.cmake
index 021d431..b005e26 100644
--- a/deployments/psa-api-test/psa-api-test.cmake
+++ b/deployments/psa-api-test/psa-api-test.cmake
@@ -20,17 +20,17 @@
 )
 
 #-------------------------------------------------------------------------------
-#  Use libpsa for locating PSA services. An appropriate version of
-#  libpsa will be imported for the environment. Making sure the link order is
+#  Use libpsats for locating PSA services. An appropriate version of
+#  libpsats will be imported for the environment. Making sure the link order is
 #  correct.
 #-------------------------------------------------------------------------------
 if (COVERAGE)
-	set(LIBPSA_BUILD_TYPE "DEBUGCOVERAGE" CACHE STRING "Libpsa build type" FORCE)
+	set(LIBPSATS_BUILD_TYPE "DEBUGCOVERAGE" CACHE STRING "Libpsats build type" FORCE)
 	set(LIBTS_BUILD_TYPE "DEBUGCOVERAGE" CACHE STRING "Libts build type" FORCE)
 endif()
 
-include(${TS_ROOT}/deployments/libpsa/libpsa-import.cmake)
-target_link_libraries( ${PROJECT_NAME} PRIVATE libpsa::psa)
+include(${TS_ROOT}/deployments/libpsats/libpsats-import.cmake)
+target_link_libraries( ${PROJECT_NAME} PRIVATE libpsats::psats)
 
 target_link_libraries(${PROJECT_NAME} PRIVATE val_nspe test_combine pal_nspe)
 
diff --git a/deployments/ts-demo/ts-demo.c b/deployments/ts-demo/ts-demo.c
index c7ef52b..5efce9f 100644
--- a/deployments/ts-demo/ts-demo.c
+++ b/deployments/ts-demo/ts-demo.c
@@ -9,7 +9,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "libpsa.h"
+#include "libpsats.h"
 
 int main(int argc, char *argv[])
 {
@@ -19,16 +19,16 @@
 	if (argc > 1)
 		service_name = argv[1];
 
-	psa_status = libpsa_init_crypto_context(service_name);
+	psa_status = libpsats_init_crypto_context(service_name);
 
 	if (psa_status) {
-		printf("libpsa_init_crypto_context failed: %d\n", psa_status);
+		printf("libpsats_init_crypto_context failed: %d\n", psa_status);
 		return psa_status;
 	}
 
 	psa_status = run_ts_demo(true);
 
-	libpsa_deinit_its_context();
+	libpsats_deinit_its_context();
 
 	if (psa_status)
 		printf("\n*** ts-demo failed ***\n\n");
diff --git a/deployments/ts-demo/ts-demo.cmake b/deployments/ts-demo/ts-demo.cmake
index 2d39042..b663fb6 100644
--- a/deployments/ts-demo/ts-demo.cmake
+++ b/deployments/ts-demo/ts-demo.cmake
@@ -12,16 +12,16 @@
 #-------------------------------------------------------------------------------
 
 #-------------------------------------------------------------------------------
-#  Use libpsa for locating PSA services. An appropriate version of
-#  libpsa will be imported for the environment.
+#  Use libpsats for locating PSA services. An appropriate version of
+#  libpsats will be imported for the environment.
 #-------------------------------------------------------------------------------
 if (COVERAGE)
-	set(LIBPSA_BUILD_TYPE "DEBUGCOVERAGE" CACHE STRING "Libpsa build type" FORCE)
+	set(LIBPSATS_BUILD_TYPE "DEBUGCOVERAGE" CACHE STRING "Libpsats build type" FORCE)
 	set(LIBTS_BUILD_TYPE "DEBUGCOVERAGE" CACHE STRING "Libts build type" FORCE)
 endif()
 
-include(${TS_ROOT}/deployments/libpsa/libpsa-import.cmake)
-target_link_libraries(ts-demo PRIVATE libpsa::psa)
+include(${TS_ROOT}/deployments/libpsats/libpsats-import.cmake)
+target_link_libraries(ts-demo PRIVATE libpsats::psats)
 
 #-------------------------------------------------------------------------------
 #  Common main for all deployments
diff --git a/docs/deployments/libraries.rst b/docs/deployments/libraries.rst
index 81d18cb..b246535 100644
--- a/docs/deployments/libraries.rst
+++ b/docs/deployments/libraries.rst
@@ -31,13 +31,13 @@
   * - Used by
     - * Userspace applications
 
-.. _libs-libpsa:
+.. _libs-libpsats:
 
-libpsa
+libpsats
 ------
-Trusted Services implements the `PSA Certified APIs`_. Libpsa encapsulates the service client implementations
-which implement this API. Linux uuser-space applications can use libpsa to easily access the PSA services
-implemented by the project. Libpsa depends on libts for RPC and service discovery services.
+Trusted Services implements the `PSA Certified APIs`_. Libpsats encapsulates the service client implementations
+which implement this API. Linux uuser-space applications can use libpsats to easily access the PSA services
+implemented by the project. Libpsats depends on libts for RPC and service discovery services.
 
 .. list-table::
   :widths: 1 2
@@ -56,7 +56,7 @@
 
 Build as shared library::
 
-  cmake -S ./trusted-services/deployments/libpsa/linux-pc/ -B ./build
+  cmake -S ./trusted-services/deployments/libpsats/linux-pc/ -B ./build
   make -C build && make -C build install
 
 .. warning::
@@ -65,38 +65,38 @@
 To integrate the library libts shall also be integrated. To achieve this add the listed
 lines to the application's cmake files::
 
-  find_package(libpsa "1.0.0" REQUIRED PATHS "<install path>")
+  find_package(libpsats "1.0.0" REQUIRED PATHS "<install path>")
   find_package(libts "2.0.0" REQUIRED PATHS "<install path>")
-  target_link_libraries(ts-demo PRIVATE libpsa::psa)
+  target_link_libraries(ts-demo PRIVATE libpsats::psats)
 
 Initialization
 ..............
 
-Before calling any function from libpsa the proper part of the library has to be initialized.
+Before calling any function from libpsats the proper part of the library has to be initialized.
 Before exiting the application (or when PSA services are no longer needed) the initialized
-parts must be deinitialized. To access the library **libpsa.h** must be included::
+parts must be deinitialized. To access the library **libpsats.h** must be included::
 
-   psa_status_t libpsa_init_crypto_context(const char *service_name);
-   void libpsa_deinit_crypto_context(void);
+   psa_status_t libpsats_init_crypto_context(const char *service_name);
+   void libpsats_deinit_crypto_context(void);
 
-   psa_status_t libpsa_init_attestation_context(const char *service_name);
-   void libpsa_deinit_attestation_context(void);
+   psa_status_t libpsats_init_attestation_context(const char *service_name);
+   void libpsats_deinit_attestation_context(void);
 
-   psa_status_t libpsa_init_its_context(const char *service_name);
-   void libpsa_deinit_its_context(void);
+   psa_status_t libpsats_init_its_context(const char *service_name);
+   void libpsats_deinit_its_context(void);
 
-   psa_status_t libpsa_init_ps_context(const char *service_name);
-   void libpsa_deinit_ps_context(void);
+   psa_status_t libpsats_init_ps_context(const char *service_name);
+   void libpsats_deinit_ps_context(void);
 
 The example below initializes and then deinitializes crypto::
 
-    psa_status_t psa_status = libpsa_init_crypto_context("sn:trustedfirmware.org:crypto:0");
+    psa_status_t psa_status = libpsats_init_crypto_context("sn:trustedfirmware.org:crypto:0");
     if (psa_status) {
-        printf("libpsa_init_crypto_context failed: %d\n", psa_status);
+        printf("libpsats_init_crypto_context failed: %d\n", psa_status);
         return PSA_ERROR_GENERIC_ERROR;
     }
 
-    libpsa_deinit_crypto_context();
+    libpsats_deinit_crypto_context();
 
 Known issues and Limitations
 ............................
diff --git a/docs/project/versioning_policy.rst b/docs/project/versioning_policy.rst
index 0d1352e..c3a5503 100644
--- a/docs/project/versioning_policy.rst
+++ b/docs/project/versioning_policy.rst
@@ -30,7 +30,7 @@
 The project hosts multiple components which can be used separately and thus need
 compatibility information expressed independently. Such components get a
 dedicated version ID. Examples are :ref:`libs-libsp` :ref:`libs-libts` and
-:ref:`libs-libpsa`.
+:ref:`libs-libpsats`.
 
 Components are never released standalone but only part of a TS release. In that
 sense a set of independent component version IDs are assigned to a TS release ID.
diff --git a/tools/b-test/test_data.yaml b/tools/b-test/test_data.yaml
index f205307..029dc1d 100644
--- a/tools/b-test/test_data.yaml
+++ b/tools/b-test/test_data.yaml
@@ -91,18 +91,18 @@
       src: "$TS_ROOT/deployments/internal-trusted-storage/config/shared-flash-opteesp"
       params:
             - "-GUnix Makefiles"
-    - name: "libpsa-arm-linux"
-      src: "$TS_ROOT/deployments/libpsa/arm-linux"
+    - name: "libpsats-arm-linux"
+      src: "$TS_ROOT/deployments/libpsats/arm-linux"
       os_id : "GNU/Linux"
       params:
             - "-GUnix Makefiles"
-    - name: "libpsa-linux-pc"
-      src: "$TS_ROOT/deployments/libpsa/linux-pc"
+    - name: "libpsats-linux-pc"
+      src: "$TS_ROOT/deployments/libpsats/linux-pc"
       os_id : "GNU/Linux"
       params:
             - "-GUnix Makefiles"
-    - name: "libpsa-coverage-linux-pc"
-      src: "$TS_ROOT/deployments/libpsa/linux-pc"
+    - name: "libpsats-coverage-linux-pc"
+      src: "$TS_ROOT/deployments/libpsats/linux-pc"
       os_id : "GNU/Linux"
       params:
             - "-GUnix Makefiles"