1 /*
2 * Copyright (C) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include "devattest_errno.h"
17 #include "devattest_client.h"
18
19 using namespace OHOS;
20 using namespace OHOS::DevAttest;
main(int argc,char * arg[])21 int main(int argc, char *arg[])
22 {
23 AttestResultInfo attestResultInfo;
24 int res = DelayedSingleton<DevAttestClient>::GetInstance()->GetAttestStatus(attestResultInfo);
25 if (res != DEVATTEST_SUCCESS) {
26 printf("[DEVATTEST]AttestTest client main fail!\n");
27 return DEVATTEST_FAIL;
28 }
29 printf("[DEVATTEST]attestResultInfo authResult [%d] softwareResult [%d]\n",
30 attestResultInfo.authResult_, attestResultInfo.softwareResult_);
31 printf("[DEVATTEST]attestResultInfo ticketLength [%d] ticket [%s]\n",
32 attestResultInfo.ticketLength_, attestResultInfo.ticket_.c_str());
33
34 for (int i = 0; i < SOFTWARE_RESULT_DETAIL_SIZE; i++) {
35 printf("[DEVATTEST]attestResultInfo softwareResultDetail[%d] %d\n",
36 i, attestResultInfo.softwareResultDetail_[i]);
37 }
38 printf("[DEVATTEST]Test client main ended successfully!\n");
39 return DEVATTEST_SUCCESS;
40 }