// Copyright 2020 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_TRUSTED_VAULT_TRUSTED_VAULT_CONNECTION_H_ #define COMPONENTS_TRUSTED_VAULT_TRUSTED_VAULT_CONNECTION_H_ #include <memory> #include <optional> #include <vector> #include "base/functional/callback.h" #include "base/time/time.h" #include "base/types/strong_alias.h" #include "third_party/abseil-cpp/absl/types/variant.h" struct CoreAccountInfo; namespace trusted_vault { class SecureBoxKeyPair; class SecureBoxPublicKey; enum class TrustedVaultRegistrationStatus { … }; enum class TrustedVaultDownloadKeysStatus { … }; // This enum is used in histograms. These values are persisted to logs. Entries // should not be renumbered and numeric values should never be reused, only add // at the end and. Also remember to update in tools/metrics/histograms/enums.xml // TrustedVaultRecoverabilityStatus enum. // LINT.IfChange(TrustedVaultRecoverabilityStatus) enum class TrustedVaultRecoverabilityStatus { … }; // LINT.ThenChange(/tools/metrics/histograms/metadata/sync/enums.xml:TrustedVaultRecoverabilityStatus) // Contains information about a Google Password Manager PIN that is stored in // a trusted vault. struct GpmPinMetadata { … }; // A MemberKeys contains the cryptographic outputs needed to add or use an // authentication factor: the trusted vault key, encrypted to the public key of // the member, and an authenticator of that public key. struct MemberKeys { … }; // A vault member public key and its member keys. struct VaultMember { … }; // The result of calling // DownloadAuthenticationFactorsRegistrationState. struct DownloadAuthenticationFactorsRegistrationStateResult { … }; // Authentication factor types: LocalPhysicalDevice; LockScreenKnowledgeFactor; ICloudKeychain; // UnspecifiedAuthenticationFactorType carries a type hint for the backend. UnspecifiedAuthenticationFactorType; AuthenticationFactorType; struct TrustedVaultKeyAndVersion { … }; // Returns a vector of `TrustedVaultKeyAndVersion` given a vector of keys and // the version of the last key, assuming that the versions are sequential. std::vector<TrustedVaultKeyAndVersion> GetTrustedVaultKeysWithVersions( const std::vector<std::vector<uint8_t>>& trusted_vault_keys, int last_key_version); // A MemberKeysSource provides a method of calculating the values needed to // add an authenticator factor. MemberKeysSource; // Supports interaction with vault service, all methods must called on trusted // vault backend sequence. class TrustedVaultConnection { … }; } // namespace trusted_vault #endif // COMPONENTS_TRUSTED_VAULT_TRUSTED_VAULT_CONNECTION_H_