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

Side by Side Diff: crypto/symmetric_key.h

Issue 7756025: Changed OAuth token+secret encryption to use supplemental user key. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « crypto/nss_util.cc ('k') | crypto/symmetric_key_nss.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CRYPTO_SYMMETRIC_KEY_H_ 5 #ifndef CRYPTO_SYMMETRIC_KEY_H_
6 #define CRYPTO_SYMMETRIC_KEY_H_ 6 #define CRYPTO_SYMMETRIC_KEY_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 CSSM_DATA cssm_data() const; 64 CSSM_DATA cssm_data() const;
65 #elif defined(OS_WIN) 65 #elif defined(OS_WIN)
66 HCRYPTKEY key() const { return key_.get(); } 66 HCRYPTKEY key() const { return key_.get(); }
67 #endif 67 #endif
68 68
69 // Extracts the raw key from the platform specific data. 69 // Extracts the raw key from the platform specific data.
70 // Warning: |raw_key| holds the raw key as bytes and thus must be handled 70 // Warning: |raw_key| holds the raw key as bytes and thus must be handled
71 // carefully. 71 // carefully.
72 bool GetRawKey(std::string* raw_key); 72 bool GetRawKey(std::string* raw_key);
73 73
74 #if defined(OS_CHROMEOS)
75 // Creates symmetric key from NSS key. Takes over the ownership of |key|.
76 static SymmetricKey* CreateFromKey(PK11SymKey* key);
77 #endif
78
74 private: 79 private:
75 #if defined(USE_OPENSSL) 80 #if defined(USE_OPENSSL)
76 SymmetricKey() {} 81 SymmetricKey() {}
77 std::string key_; 82 std::string key_;
78 #elif defined(USE_NSS) 83 #elif defined(USE_NSS)
79 explicit SymmetricKey(PK11SymKey* key); 84 explicit SymmetricKey(PK11SymKey* key);
80 ScopedPK11SymKey key_; 85 ScopedPK11SymKey key_;
81 #elif defined(OS_MACOSX) 86 #elif defined(OS_MACOSX)
82 SymmetricKey(const void* key_data, size_t key_size_in_bits); 87 SymmetricKey(const void* key_data, size_t key_size_in_bits);
83 std::string key_; 88 std::string key_;
(...skipping 12 matching lines...) Expand all
96 // fails with NTE_BAD_KEY/NTE_BAD_LEN 101 // fails with NTE_BAD_KEY/NTE_BAD_LEN
97 std::string raw_key_; 102 std::string raw_key_;
98 #endif 103 #endif
99 104
100 DISALLOW_COPY_AND_ASSIGN(SymmetricKey); 105 DISALLOW_COPY_AND_ASSIGN(SymmetricKey);
101 }; 106 };
102 107
103 } // namespace crypto 108 } // namespace crypto
104 109
105 #endif // CRYPTO_SYMMETRIC_KEY_H_ 110 #endif // CRYPTO_SYMMETRIC_KEY_H_
OLDNEW
« no previous file with comments | « crypto/nss_util.cc ('k') | crypto/symmetric_key_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698