• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_client.h"
17 
18 #include <string>
19 #include <cstdio>
20 
21 #include "iservice_registry.h"
22 #include "system_ability_definition.h"
23 #include "system_ability.h"
24 #include "singleton.h"
25 
26 #include "devattest_errno.h"
27 #include "attest_result_info.h"
28 
29 using namespace OHOS;
30 using namespace OHOS::DevAttest;
main(int argc,char * arg[])31 int main(int argc, char *arg[])
32 {
33     AttestResultInfo attestResultInfo;
34     int res = DelayedSingleton<DevAttestClient>::GetInstance()->GetAttestStatus(attestResultInfo);
35     if (res != DEVATTEST_SUCCESS) {
36         printf("[DEVATTEST]AttestTest client main fail!\n");
37         return DEVATTEST_FAIL;
38     }
39     printf("[DEVATTEST]attestResultInfo authResult [%d] softwareResult [%d]\n",
40         attestResultInfo.authResult_, attestResultInfo.softwareResult_);
41     printf("[DEVATTEST]attestResultInfo ticketLength [%d] ticket [%s]\n",
42         attestResultInfo.ticketLength_, attestResultInfo.ticket_.c_str());
43 
44     for (int i = 0; i < SOFTWARE_RESULT_DETAIL_SIZE; i++) {
45         printf("[DEVATTEST]attestResultInfo softwareResultDetail[%d] %d\n",
46             i, attestResultInfo.softwareResultDetail_[i]);
47     }
48     printf("[DEVATTEST]Test client main ended successfully!\n");
49     return DEVATTEST_SUCCESS;
50 }