// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Sync protocol datatype extension for nigori keys.

// Update proto_value_conversions{.h,.cc,_unittest.cc} if you change
// any fields in this file.

syntax = "proto2";

option optimize_for = LITE_RUNTIME;
option retain_unknown_fields = true;

package sync_pb;

import "encryption.proto";
import "sync.proto";

message NigoriKey {
  optional string name = 1;
  optional bytes user_key = 2;
  optional bytes encryption_key = 3;
  optional bytes mac_key = 4;
}

message NigoriKeyBag {
  repeated NigoriKey key = 2;
}

// Properties of nigori sync object.
message NigoriSpecifics {
  optional EncryptedData encrypted = 1;
  // True if |encrypted| is encrypted using a passphrase
  // explicitly set by the user.
  optional bool using_explicit_passphrase = 2;
  
  // Booleans corresponding to whether a datatype should be encrypted.
  // Passwords are always encrypted, so we don't need a field here.
  optional bool encrypt_bookmarks = 3;
  optional bool encrypt_preferences = 4;
  optional bool encrypt_autofill_profile = 5;
  optional bool encrypt_autofill = 6;
  optional bool encrypt_themes = 7;
  optional bool encrypt_typed_urls = 8;
  optional bool encrypt_extensions = 9;
  optional bool encrypt_sessions = 10;
  optional bool encrypt_apps = 11;
}

extend EntitySpecifics {
  optional NigoriSpecifics nigori = 47745;
}