return 0;
}
+
+//& purpose: Gets the information about all the aliases of keys that the client can access.
+//& type: auto
+/**
+* @testcase ITc_ckmc_get_key_alias_info_list_p
+* @since 5.5
+* @author SRID(karanam.s)
+* @reviewer SRID(manoj.g2)
+* @type auto
+* @scenario Gets the information about all the aliases of keys that the client can access.
+* @apicovered ckmc_get_key_alias_info_list
+* @passcase When ckmc_get_key_alias_info_list API returns 0
+* @failcase If ckmc_get_key_alias_info_list returns non zero value
+* @precondition User is already logged in and the user key is already loaded into memory in plain text form.
+* @postcondition NA
+*/
+int ITc_ckmc_get_key_alias_info_list_p(void)
+{
+ START_TEST;
+
+ int nRet = -1;
+ char* pszAlias1 = "Alias1";
+ char* pszAlias2 = "Alias2";
+
+ //precondition start
+ SaveKey(pszAlias1, &nRet);
+ PRINT_RESULT(CKMC_ERROR_NONE, nRet, "Precondition1 failed for ITc_ckmc_get_key_alias_info_list_p", KeyMngrGetError(nRet));
+
+ SaveKey(pszAlias2, &nRet);
+ PRINT_RESULT_CLEANUP(CKMC_ERROR_NONE, nRet, "Precondition2 failed for ITc_ckmc_get_key_alias_info_list_p", KeyMngrGetError(nRet), RemoveAlias(pszAlias1));
+ //precondition end
+
+ ckmc_alias_info_list_s *pszAliasList = NULL;
+ nRet = ckmc_get_key_alias_info_list(&pszAliasList); //Target API
+ PRINT_RESULT_CLEANUP(CKMC_ERROR_NONE, nRet, "ckmc_get_key_alias_info_list", KeyMngrGetError(nRet), RemoveAlias(pszAlias1);RemoveAlias(pszAlias2));
+ CHECK_HANDLE_CLEANUP(pszAliasList, "ckmc_get_key_alias_info_list", RemoveAlias(pszAlias1);RemoveAlias(pszAlias2));
+
+ ckmc_alias_info_list_all_free(pszAliasList);
+ nRet = get_last_result();
+ PRINT_RESULT_NORETURN(CKMC_ERROR_NONE, nRet, "ckmc_alias_info_list_all_free", KeyMngrGetError(nRet));
+ RemoveAlias(pszAlias1);
+ RemoveAlias(pszAlias2);
+
+ return 0;
+}
+
+//& purpose: Destroys the #ckmc_alias_info_list_s handle and releases resources of #ckmc_alias_info_list_s from the provided first handle cascadingly.
+//& type: auto
+/**
+* @testcase ITc_ckmc_alias_info_list_all_free_p
+* @since 5.5
+* @author SRID(karanam.s)
+* @reviewer SRID(manoj.g2)
+* @type auto
+* @scenario Destroys the ckmc_alias_info_list_s handle and releases resources of ckmc_alias_info_list_s from the provided first handle cascadingly.
+* @apicovered ckmc_alias_info_list_all_free
+* @passcase When ckmc_alias_info_list_all_free API returns 0
+* @failcase If ckmc_alias_info_list_all_free returns non zero value
+* @precondition NA
+* @postcondition NA
+*/
+int ITc_ckmc_alias_info_list_all_free_p(void)
+{
+ START_TEST;
+
+ int nRet = -1;
+ char* pszAlias1 = "Alias1";
+ char* pszAlias2 = "Alias2";
+
+ //precondition start
+ SaveKey(pszAlias1, &nRet);
+ PRINT_RESULT(CKMC_ERROR_NONE, nRet, "Precondition1 failed for ITc_ckmc_alias_info_list_all_free_p", KeyMngrGetError(nRet));
+
+ SaveKey(pszAlias2, &nRet);
+ PRINT_RESULT_CLEANUP(CKMC_ERROR_NONE, nRet, "Precondition2 failed for ITc_ckmc_alias_info_list_all_free_p", KeyMngrGetError(nRet), RemoveAlias(pszAlias1));
+ //precondition end
+
+ ckmc_alias_info_list_s *pszAliasList = NULL;
+ nRet = ckmc_get_key_alias_info_list(&pszAliasList);
+ PRINT_RESULT_CLEANUP(CKMC_ERROR_NONE, nRet, "ckmc_get_key_alias_info_list", KeyMngrGetError(nRet), RemoveAlias(pszAlias1);RemoveAlias(pszAlias2));
+ CHECK_HANDLE_CLEANUP(pszAliasList, "ckmc_get_key_alias_info_list", RemoveAlias(pszAlias1);RemoveAlias(pszAlias2));
+
+ ckmc_alias_info_list_all_free(pszAliasList); //Target API
+ nRet = get_last_result();
+ PRINT_RESULT_CLEANUP(CKMC_ERROR_NONE, nRet, "ckmc_alias_info_list_all_free", KeyMngrGetError(nRet), RemoveAlias(pszAlias1);RemoveAlias(pszAlias2));
+ RemoveAlias(pszAlias1);
+ RemoveAlias(pszAlias2);
+
+ return 0;
+}
+
+//& purpose: Gets the information about all the aliases of certificates that the client can access.
+//& type: auto
+/**
+* @testcase ITc_ckmc_get_cert_alias_info_list_p
+* @since 5.5
+* @author SRID(karanam.s)
+* @reviewer SRID(manoj.g2)
+* @type auto
+* @scenario Gets the information about all the aliases of certificates that the client can access.
+* @apicovered ckmc_get_cert_alias_info_list
+* @passcase When ckmc_get_cert_alias_info_list API returns 0
+* @failcase If ckmc_get_cert_alias_info_list returns non zero value
+* @precondition User is already logged in and the user key is already loaded into memory in plain text form.
+* @postcondition NA
+*/
+int ITc_ckmc_get_cert_alias_info_list_p(void)
+{
+ START_TEST;
+
+ int nRet = -1;
+ char* pszAlias1 = "get_cert1_p";
+ char* pszAlias2 = "get_cert2_p";
+
+ //precondition start
+ SaveCertificate(pszAlias1, &nRet);
+ PRINT_RESULT(CKMC_ERROR_NONE, nRet, "Precondition1 failed to execute ckmc_save_cert", KeyMngrGetError(nRet));
+
+ SaveCertificate(pszAlias2, &nRet);
+ PRINT_RESULT_CLEANUP(CKMC_ERROR_NONE, nRet, "Precondition2 failed to execute ckmc_save_cert", KeyMngrGetError(nRet), RemoveAlias(pszAlias1));
+ //precondition end
+
+ ckmc_alias_info_list_s* pszAliasList = NULL;
+ nRet = ckmc_get_cert_alias_info_list(&pszAliasList); //Target API
+ PRINT_RESULT_CLEANUP(CKMC_ERROR_NONE, nRet, "ckmc_get_cert_alias_info_list", KeyMngrGetError(nRet), RemoveAlias(pszAlias1);RemoveAlias(pszAlias2));
+ CHECK_HANDLE_CLEANUP(pszAliasList, "ckmc_get_cert_alias_info_list", RemoveAlias(pszAlias1);RemoveAlias(pszAlias2));
+
+ ckmc_alias_info_list_all_free(pszAliasList);
+ nRet = get_last_result();
+ PRINT_RESULT_NORETURN(CKMC_ERROR_NONE, nRet, "ckmc_alias_info_list_all_free", KeyMngrGetError(nRet));
+ RemoveAlias(pszAlias1);
+ RemoveAlias(pszAlias2);
+}
+
+//& purpose: Gets the information about all the aliases of data that the client can access.
+//& type: auto
+/**
+* @testcase ITc_ckmc_get_data_alias_info_list_p
+* @since 5.5
+* @author SRID(karanam.s)
+* @reviewer SRID(manoj.g2)
+* @type auto
+* @scenario Gets the information about all the aliases of data that the client can access.
+* @apicovered ckmc_get_data_alias_info_list
+* @passcase When ckmc_get_data_alias_info_list API returns 0
+* @failcase If ckmc_get_data_alias_info_list returns non zero value
+* @precondition User is already logged in and the user key is already loaded into memory in plain text form.
+* @postcondition NA
+*/
+int ITc_ckmc_get_data_alias_info_list_p(void)
+{
+ START_TEST;
+
+ int nRet = -1;
+ char *pszAlias1 = "AliasSaveData1";
+ char *pszAlias2 = "AliasSaveData2";
+
+ //precondition start
+ SaveData(pszAlias1, &nRet);
+ PRINT_RESULT(CKMC_ERROR_NONE, nRet, "Precondition1 failed to execute ITc_ckmc_get_data_p", KeyMngrGetError(nRet));
+
+ SaveData(pszAlias2, &nRet);
+ PRINT_RESULT_CLEANUP(CKMC_ERROR_NONE, nRet, "Precondition1 failed to execute ITc_ckmc_get_data_p", KeyMngrGetError(nRet), RemoveAlias(pszAlias1));
+ //precondition end
+
+ ckmc_alias_info_list_s* pszAliasList = NULL;
+ nRet = ckmc_get_data_alias_info_list(&pszAliasList); //Target API
+ PRINT_RESULT_CLEANUP(CKMC_ERROR_NONE, nRet, "ckmc_get_data_alias_info_list", KeyMngrGetError(nRet), RemoveAlias(pszAlias1);RemoveAlias(pszAlias2));
+ CHECK_HANDLE_CLEANUP(pszAliasList, "ckmc_get_data_alias_info_list", RemoveAlias(pszAlias1);RemoveAlias(pszAlias2));
+
+ ckmc_alias_info_list_all_free(pszAliasList);
+ nRet = get_last_result();
+ PRINT_RESULT_NORETURN(CKMC_ERROR_NONE, nRet, "ckmc_alias_info_list_all_free", KeyMngrGetError(nRet));
+ RemoveAlias(pszAlias1);
+ RemoveAlias(pszAlias2);
+
+ return 0;
+}
+
+//& purpose: Gets the password protection status from ckmc_alias_info_s structure.
+//& type: auto
+/**
+* @testcase ITc_ckmc_alias_info_is_password_protected_p
+* @since 5.5
+* @author SRID(karanam.s)
+* @reviewer SRID(manoj.g2)
+* @type auto
+* @scenario Gets the password protection status from ckmc_alias_info_s structure.
+* @apicovered ckmc_alias_info_is_password_protected
+* @passcase When ckmc_alias_info_is_password_protected API returns 0
+* @failcase If ckmc_alias_info_is_password_protected returns non zero value
+* @precondition NA
+* @postcondition NA
+*/
+int ITc_ckmc_alias_info_is_password_protected_p(void)
+{
+ START_TEST;
+
+ int nRet = -1;
+ char* pszAlias1 = "Alias1";
+ char* pszAlias2 = "Alias2";
+ bool bIsPasswordProtected = false;
+
+ //precondition start
+ SaveKey(pszAlias1, &nRet);
+ PRINT_RESULT(CKMC_ERROR_NONE, nRet, "Precondition1 failed for ITc_ckmc_get_key_alias_info_list_p", KeyMngrGetError(nRet));
+
+ SaveKey(pszAlias2, &nRet);
+ PRINT_RESULT_CLEANUP(CKMC_ERROR_NONE, nRet, "Precondition2 failed for ITc_ckmc_get_key_alias_info_list_p", KeyMngrGetError(nRet), RemoveAlias(pszAlias1));
+ //precondition end
+
+ ckmc_alias_info_list_s *pszAliasList = NULL;
+ nRet = ckmc_get_key_alias_info_list(&pszAliasList);
+ PRINT_RESULT_CLEANUP(CKMC_ERROR_NONE, nRet, "ckmc_get_key_alias_info_list", KeyMngrGetError(nRet), RemoveAlias(pszAlias1);RemoveAlias(pszAlias2));
+ CHECK_HANDLE_CLEANUP(pszAliasList, "ckmc_get_key_alias_info_list", RemoveAlias(pszAlias1);RemoveAlias(pszAlias2));
+
+ nRet = ckmc_alias_info_is_password_protected(pszAliasList->info, &bIsPasswordProtected);
+ PRINT_RESULT_CLEANUP(CKMC_ERROR_NONE, nRet, "ckmc_alias_info_is_password_protected", KeyMngrGetError(nRet), RemoveAlias(pszAlias1);RemoveAlias(pszAlias2);ckmc_alias_info_list_all_free(pszAliasList));
+
+ ckmc_alias_info_list_all_free(pszAliasList);
+ nRet = get_last_result();
+ PRINT_RESULT_NORETURN(CKMC_ERROR_NONE, nRet, "ckmc_alias_info_list_all_free", KeyMngrGetError(nRet));
+ RemoveAlias(pszAlias1);
+ RemoveAlias(pszAlias2);
+}
+
+//& purpose: Gets the alias from #ckmc_alias_info_s structure.
+//& type: auto
+/**
+* @testcase ITc_ckmc_alias_info_get_alias_p
+* @since 5.5
+* @author SRID(karanam.s)
+* @reviewer SRID(manoj.g2)
+* @type auto
+* @scenario Gets the alias from ckmc_alias_info_s structure.
+* @apicovered ckmc_alias_info_get_alias
+* @passcase When ckmc_alias_info_get_alias API returns 0
+* @failcase If ckmc_alias_info_get_alias returns non zero value
+* @precondition NA
+* @postcondition NA
+*/
+int ITc_ckmc_alias_info_get_alias_p(void)
+{
+ START_TEST;
+
+ int nRet = -1;
+ char* pszAlias1 = "Alias1";
+ char* pszAlias2 = "Alias2";
+ char *pszAlias = NULL;
+
+ //precondition start
+ SaveKey(pszAlias1, &nRet);
+ PRINT_RESULT(CKMC_ERROR_NONE, nRet, "Precondition1 failed for ITc_ckmc_get_key_alias_info_list_p", KeyMngrGetError(nRet));
+
+ SaveKey(pszAlias2, &nRet);
+ PRINT_RESULT_CLEANUP(CKMC_ERROR_NONE, nRet, "Precondition2 failed for ITc_ckmc_get_key_alias_info_list_p", KeyMngrGetError(nRet), RemoveAlias(pszAlias1));
+ //precondition end
+
+ ckmc_alias_info_list_s *pszAliasList = NULL;
+ nRet = ckmc_get_key_alias_info_list(&pszAliasList);
+ PRINT_RESULT_CLEANUP(CKMC_ERROR_NONE, nRet, "ckmc_get_key_alias_info_list", KeyMngrGetError(nRet), RemoveAlias(pszAlias1);RemoveAlias(pszAlias2));
+ CHECK_HANDLE_CLEANUP(pszAliasList, "ckmc_get_key_alias_info_list", RemoveAlias(pszAlias1);RemoveAlias(pszAlias2));
+
+ nRet = ckmc_alias_info_get_alias(pszAliasList->info, &pszAlias);
+ PRINT_RESULT_CLEANUP(CKMC_ERROR_NONE, nRet, "ckmc_alias_info_get_alias", KeyMngrGetError(nRet), RemoveAlias(pszAlias1);RemoveAlias(pszAlias2);ckmc_alias_info_list_all_free(pszAliasList));
+ CHECK_HANDLE_CLEANUP(pszAlias, "ckmc_alias_info_get_alias", ckmc_alias_info_list_all_free(pszAliasList);RemoveAlias(pszAlias1);RemoveAlias(pszAlias2));
+
+ ckmc_alias_info_list_all_free(pszAliasList);
+ nRet = get_last_result();
+ PRINT_RESULT_NORETURN(CKMC_ERROR_NONE, nRet, "ckmc_alias_info_list_all_free", KeyMngrGetError(nRet));
+ RemoveAlias(pszAlias1);
+ RemoveAlias(pszAlias2);
+}
/** @} */
/** @} */