11e934351Sopenharmony_ci/*
21e934351Sopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd.
31e934351Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
41e934351Sopenharmony_ci * you may not use this file except in compliance with the License.
51e934351Sopenharmony_ci * You may obtain a copy of the License at
61e934351Sopenharmony_ci *
71e934351Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
81e934351Sopenharmony_ci *
91e934351Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
101e934351Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
111e934351Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
121e934351Sopenharmony_ci * See the License for the specific language governing permissions and
131e934351Sopenharmony_ci * limitations under the License.
141e934351Sopenharmony_ci */
151e934351Sopenharmony_ci
161e934351Sopenharmony_ci#ifndef COMMUNICATION_NETSTACK_SECURE_CHAR_H
171e934351Sopenharmony_ci#define COMMUNICATION_NETSTACK_SECURE_CHAR_H
181e934351Sopenharmony_ci
191e934351Sopenharmony_ci#include <cstddef>
201e934351Sopenharmony_ci#include <memory>
211e934351Sopenharmony_ci#include <string>
221e934351Sopenharmony_ci
231e934351Sopenharmony_cinamespace OHOS::NetStack::Secure {
241e934351Sopenharmony_ciclass SecureChar {
251e934351Sopenharmony_cipublic:
261e934351Sopenharmony_ci    SecureChar();
271e934351Sopenharmony_ci    ~SecureChar();
281e934351Sopenharmony_ci    explicit SecureChar(const std::string &SecureChar);
291e934351Sopenharmony_ci    SecureChar(const uint8_t *SecureChar, size_t length);
301e934351Sopenharmony_ci    SecureChar(const SecureChar &SecureChar);
311e934351Sopenharmony_ci    SecureChar &operator=(const SecureChar &SecureChar);
321e934351Sopenharmony_ci
331e934351Sopenharmony_ci    const char *Data() const;
341e934351Sopenharmony_ci    size_t Length() const;
351e934351Sopenharmony_ci
361e934351Sopenharmony_ciprivate:
371e934351Sopenharmony_ci    size_t length_ = 0;
381e934351Sopenharmony_ci    std::unique_ptr<char[]> data_ = nullptr;
391e934351Sopenharmony_ci};
401e934351Sopenharmony_ci} // namespace OHOS::NetStack::Secure
411e934351Sopenharmony_ci#endif // COMMUNICATION_NETSTACK_SECURE_CHAR_H