1 /*
2  * Copyright (C) 2023 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 I_SECURE_ELEMENT_VENDOR_H
17 #define I_SECURE_ELEMENT_VENDOR_H
18 
19 #include "v1_0/isecure_element_interface.h"
20 
21 namespace OHOS {
22 namespace HDI {
23 namespace SecureElement {
24 using OHOS::HDI::SecureElement::V1_0::ISecureElementCallback;
25 using OHOS::HDI::SecureElement::V1_0::SecureElementStatus;
26 
27 class ISecureElementVendor {
28 public:
~ISecureElementVendor()29     virtual ~ISecureElementVendor() {}
30 
31     virtual int32_t init(const sptr<ISecureElementCallback>& clientCallback, SecureElementStatus& status) = 0;
32 
33     virtual int32_t getAtr(std::vector<uint8_t>& response) = 0;
34 
35     virtual int32_t isSecureElementPresent(bool& present) = 0;
36 
37     virtual int32_t openLogicalChannel(const std::vector<uint8_t>& aid, uint8_t p2, std::vector<uint8_t>& response,
38         uint8_t& channelNumber, SecureElementStatus& status) = 0;
39 
40     virtual int32_t openBasicChannel(const std::vector<uint8_t>& aid, uint8_t p2, std::vector<uint8_t>& response,
41         SecureElementStatus& status) = 0;
42 
43     virtual int32_t closeChannel(uint8_t channelNumber, SecureElementStatus& status) = 0;
44 
45     virtual int32_t transmit(const std::vector<uint8_t>& command, std::vector<uint8_t>& response,
46         SecureElementStatus& status) = 0;
47 
48     virtual int32_t reset(SecureElementStatus& status) = 0;
49 };
50 } // SecureElement
51 } // HDI
52 } // OHOS
53 #endif /* I_SECURE_ELEMENT_VENDOR_H */
54