Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(485)

Side by Side Diff: src/platform/cryptohome/vault_keyset.h

Issue 2051003: Initial patch from Will. (Closed) Base URL: ssh://git@chromiumos-git/chromiumos
Patch Set: Address style nits. Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2009-2010 The Chromium OS 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.
4
5 #ifndef VAULT_KEYSET_H_
6 #define VAULT_KEYSET_H_
7
8 #include "cryptohome/entropy_source.h"
9 #include "cryptohome/secure_blob.h"
10
11 namespace cryptohome {
12
13 const char kVaultKeysetSignature[] = "ch";
14
15 #define CRYPTOHOME_VAULT_KEYSET_VERSION_MAJOR 1
16 #define CRYPTOHOME_VAULT_KEYSET_VERSION_MINOR 0
17
18 // VaultKeyset holds the File Encryption Key (FEK) and File Name Encryption Key
19 // (FNEK) and their corresponding signatures.
20 class VaultKeyset {
21 public:
22 VaultKeyset();
23 VaultKeyset(const SecureBlob& source);
24
25 bool AssignBuffer(const SecureBlob& buffer);
26 SecureBlob ToBuffer() const;
27
28 void CreateRandom(const EntropySource& entropy_source);
29
30 const SecureBlob& FEK() const;
31 const SecureBlob& FEK_SIG() const;
32 const SecureBlob& FEK_SALT() const;
33 const SecureBlob& FNEK() const;
34 const SecureBlob& FNEK_SIG() const;
35 const SecureBlob& FNEK_SALT() const;
36
37 static unsigned int SerializedSize();
38
39 private:
40 SecureBlob fek_;
41 SecureBlob fek_sig_;
42 SecureBlob fek_salt_;
43 SecureBlob fnek_;
44 SecureBlob fnek_sig_;
45 SecureBlob fnek_salt_;
46 unsigned short major_version_;
47 unsigned short minor_version_;
48
49 DISALLOW_COPY_AND_ASSIGN(VaultKeyset);
50 };
51
52 } // cryptohome
53
54 #endif // VAULT_KEYSET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698