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 SYNC_REMOTE_NATIVE_TOKEN_COMMAND_H 17 #define SYNC_REMOTE_NATIVE_TOKEN_COMMAND_H 18 19 #include <string> 20 #include <vector> 21 22 #include "base_remote_command.h" 23 #include "native_token_info.h" 24 25 namespace OHOS { 26 namespace Security { 27 namespace AccessToken { 28 /** 29 * Command which used to get all native token info from other device. 30 */ 31 class SyncRemoteNativeTokenCommand : public BaseRemoteCommand { 32 public: 33 void Prepare() override; 34 35 void Execute() override; 36 37 void Finish() override; 38 39 std::string ToJsonPayload() override; 40 41 SyncRemoteNativeTokenCommand(const std::string &json); 42 SyncRemoteNativeTokenCommand(const std::string &srcDeviceId, const std::string &dstDeviceId); 43 virtual ~SyncRemoteNativeTokenCommand() = default; 44 45 private: 46 /** 47 * The command name. Should be equal to class name. 48 */ 49 const std::string COMMAND_NAME = "SyncRemoteNativeTokenCommand"; 50 std::vector<NativeTokenInfo> nativeTokenInfo_; 51 }; 52 } // namespace AccessToken 53 } // namespace Security 54 } // namespace OHOS 55 #endif