Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / chromeos / cryptohome / cryptohome_parameters.cc
blobeb6d906b68089ef73daa988acc0ad453a53b6dbf
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chromeos/cryptohome/cryptohome_parameters.h"
7 namespace cryptohome {
10 Identification::Identification(const std::string& user_id) : user_id(user_id) {
13 bool Identification::operator==(const Identification& other) const {
14 return user_id == other.user_id;
17 KeyDefinition::KeyDefinition(const std::string& key,
18 const std::string& label,
19 int /*AuthKeyPrivileges*/ privileges)
20 : label(label),
21 revision(1),
22 key(key),
23 privileges(privileges) {
26 KeyDefinition::~KeyDefinition() {
29 bool KeyDefinition::operator==(const KeyDefinition& other) const {
30 return label == other.label &&
31 revision == other.revision &&
32 key == other.key &&
33 encryption_key == other.encryption_key &&
34 signature_key == other.signature_key &&
35 privileges == other.privileges;
38 Authorization::Authorization(const std::string& key, const std::string& label)
39 : key(key),
40 label(label) {
43 Authorization::Authorization(const KeyDefinition& key_def)
44 : key(key_def.key),
45 label(key_def.label) {
48 bool Authorization::operator==(const Authorization& other) const {
49 return key == other.key && label == other.label;
52 MountParameters::MountParameters(bool ephemeral) : ephemeral(ephemeral) {
55 MountParameters::~MountParameters() {
58 bool MountParameters::operator==(const MountParameters& other) const {
59 return ephemeral == other.ephemeral && create_keys == other.create_keys;
62 } // namespace cryptohome