mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
49 lines
1.8 KiB
C++
49 lines
1.8 KiB
C++
// Copyright 2022 Google LLC
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// https://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
#ifndef THIRD_PARTY_NEARBY_SHARING_CERTIFICATES_NEARBY_SHARE_ENCRYPTED_METADATA_KEY_H_
|
|
#define THIRD_PARTY_NEARBY_SHARING_CERTIFICATES_NEARBY_SHARE_ENCRYPTED_METADATA_KEY_H_
|
|
|
|
#include <cstdint>
|
|
#include <vector>
|
|
|
|
namespace nearby {
|
|
namespace sharing {
|
|
|
|
// Holds the encrypted symmetric key--the key used to encrypt user/device
|
|
// metadata--as well as the salt used to encrypt the key.
|
|
class NearbyShareEncryptedMetadataKey {
|
|
public:
|
|
NearbyShareEncryptedMetadataKey(std::vector<uint8_t> salt,
|
|
std::vector<uint8_t> encrypted_key);
|
|
NearbyShareEncryptedMetadataKey(const NearbyShareEncryptedMetadataKey&);
|
|
NearbyShareEncryptedMetadataKey& operator=(
|
|
const NearbyShareEncryptedMetadataKey&);
|
|
NearbyShareEncryptedMetadataKey(NearbyShareEncryptedMetadataKey&&);
|
|
NearbyShareEncryptedMetadataKey& operator=(NearbyShareEncryptedMetadataKey&&);
|
|
~NearbyShareEncryptedMetadataKey();
|
|
|
|
const std::vector<uint8_t>& salt() const { return salt_; }
|
|
const std::vector<uint8_t>& encrypted_key() const { return encrypted_key_; }
|
|
|
|
private:
|
|
std::vector<uint8_t> salt_;
|
|
std::vector<uint8_t> encrypted_key_;
|
|
};
|
|
|
|
} // namespace sharing
|
|
} // namespace nearby
|
|
|
|
#endif // THIRD_PARTY_NEARBY_SHARING_CERTIFICATES_NEARBY_SHARE_ENCRYPTED_METADATA_KEY_H_
|