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#ifndef DSLM_CREDENTIAL_H
17#define DSLM_CREDENTIAL_H
18
19#include <stdint.h>
20
21#include "dslm_cred.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27int32_t DefaultRequestDslmCred(const DeviceIdentify *device, const RequestObject *obj, DslmCredBuff **credBuff);
28
29int32_t DefaultVerifyDslmCred(const DeviceIdentify *device, uint64_t challenge, const DslmCredBuff *credBuff,
30    DslmCredInfo *credInfo);
31
32int32_t DefaultInitDslmCred(DslmCredInfo *credInfo);
33
34int32_t GetSupportedCredTypes(CredType *list, uint32_t len);
35
36int32_t VerifyOhosDslmCred(const DeviceIdentify *device, uint64_t challenge, const DslmCredBuff *credBuff,
37    DslmCredInfo *credInfo);
38
39int32_t RequestOhosDslmCred(const DeviceIdentify *device, const RequestObject *obj, DslmCredBuff **credBuff);
40
41int32_t InitOhosDslmCred(DslmCredInfo *credInfo);
42
43int32_t GetCredFromCurrentDevice(char *credStr, uint32_t maxLen);
44
45#ifdef __cplusplus
46}
47#endif
48#endif // DSLM_CREDENTIAL_H
49