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"
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
)
23 privileges(privileges
) {
26 KeyDefinition::~KeyDefinition() {
29 bool KeyDefinition::operator==(const KeyDefinition
& other
) const {
30 return label
== other
.label
&&
31 revision
== other
.revision
&&
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
)
43 Authorization::Authorization(const KeyDefinition
& key_def
)
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