15bbf6e98Sopenharmony_ci/* 25bbf6e98Sopenharmony_ci * Copyright (C) 2022 Huawei Device Co., Ltd. 35bbf6e98Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 45bbf6e98Sopenharmony_ci * you may not use this file except in compliance with the License. 55bbf6e98Sopenharmony_ci * You may obtain a copy of the License at 65bbf6e98Sopenharmony_ci * 75bbf6e98Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 85bbf6e98Sopenharmony_ci * 95bbf6e98Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 105bbf6e98Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 115bbf6e98Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 125bbf6e98Sopenharmony_ci * See the License for the specific language governing permissions and 135bbf6e98Sopenharmony_ci * limitations under the License. 145bbf6e98Sopenharmony_ci */ 155bbf6e98Sopenharmony_ci 165bbf6e98Sopenharmony_ci#include "devattest_errno.h" 175bbf6e98Sopenharmony_ci#include "devattest_client.h" 185bbf6e98Sopenharmony_ci 195bbf6e98Sopenharmony_ciusing namespace OHOS; 205bbf6e98Sopenharmony_ciusing namespace OHOS::DevAttest; 215bbf6e98Sopenharmony_ciint main(int argc, char *arg[]) 225bbf6e98Sopenharmony_ci{ 235bbf6e98Sopenharmony_ci AttestResultInfo attestResultInfo; 245bbf6e98Sopenharmony_ci int res = DevAttestClient::GetInstance().GetAttestStatus(attestResultInfo); 255bbf6e98Sopenharmony_ci if (res != DEVATTEST_SUCCESS) { 265bbf6e98Sopenharmony_ci printf("[DEVATTEST]AttestTest client main fail!\n"); 275bbf6e98Sopenharmony_ci return DEVATTEST_FAIL; 285bbf6e98Sopenharmony_ci } 295bbf6e98Sopenharmony_ci printf("[DEVATTEST]attestResultInfo authResult [%d] softwareResult [%d]\n", 305bbf6e98Sopenharmony_ci attestResultInfo.authResult_, attestResultInfo.softwareResult_); 315bbf6e98Sopenharmony_ci printf("[DEVATTEST]attestResultInfo ticketLength [%d] ticket [%s]\n", 325bbf6e98Sopenharmony_ci attestResultInfo.ticketLength_, attestResultInfo.ticket_.c_str()); 335bbf6e98Sopenharmony_ci 345bbf6e98Sopenharmony_ci for (int i = 0; i < SOFTWARE_RESULT_DETAIL_SIZE; i++) { 355bbf6e98Sopenharmony_ci printf("[DEVATTEST]attestResultInfo softwareResultDetail[%d] %d\n", 365bbf6e98Sopenharmony_ci i, attestResultInfo.softwareResultDetail_[i]); 375bbf6e98Sopenharmony_ci } 385bbf6e98Sopenharmony_ci printf("[DEVATTEST]Test client main ended successfully!\n"); 395bbf6e98Sopenharmony_ci return DEVATTEST_SUCCESS; 405bbf6e98Sopenharmony_ci}