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

Side by Side Diff: crypto/symmetric_key.h

Issue 2934893003: Deleted redundant SymmetricKey::GetRawKey(). (Closed)
Patch Set: Rebased to fix conflict with ToT. Created 3 years, 6 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
« no previous file with comments | « crypto/hmac.cc ('k') | crypto/symmetric_key.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // SymmetricKey. 43 // SymmetricKey.
44 static std::unique_ptr<SymmetricKey> DeriveKeyFromPassword( 44 static std::unique_ptr<SymmetricKey> DeriveKeyFromPassword(
45 Algorithm algorithm, 45 Algorithm algorithm,
46 const std::string& password, 46 const std::string& password,
47 const std::string& salt, 47 const std::string& salt,
48 size_t iterations, 48 size_t iterations,
49 size_t key_size_in_bits); 49 size_t key_size_in_bits);
50 50
51 // Imports an array of key bytes in |raw_key|. This key may have been 51 // Imports an array of key bytes in |raw_key|. This key may have been
52 // generated by GenerateRandomKey or DeriveKeyFromPassword and exported with 52 // generated by GenerateRandomKey or DeriveKeyFromPassword and exported with
53 // GetRawKey, or via another compatible method. The key must be of suitable 53 // key(). The key must be of suitable size for use with |algorithm|.
54 // size for use with |algorithm|. The caller owns the returned SymmetricKey. 54 // The caller owns the returned SymmetricKey.
55 static std::unique_ptr<SymmetricKey> Import(Algorithm algorithm, 55 static std::unique_ptr<SymmetricKey> Import(Algorithm algorithm,
56 const std::string& raw_key); 56 const std::string& raw_key);
57 57
58 // Returns the raw platform specific key data.
58 const std::string& key() const { return key_; } 59 const std::string& key() const { return key_; }
59 60
60 // Extracts the raw key from the platform specific data.
61 // Warning: |raw_key| holds the raw key as bytes and thus must be handled
62 // carefully.
63 bool GetRawKey(std::string* raw_key) const;
64
65 private: 61 private:
66 SymmetricKey(); 62 SymmetricKey();
67 63
68 std::string key_; 64 std::string key_;
69 65
70 DISALLOW_COPY_AND_ASSIGN(SymmetricKey); 66 DISALLOW_COPY_AND_ASSIGN(SymmetricKey);
71 }; 67 };
72 68
73 } // namespace crypto 69 } // namespace crypto
74 70
75 #endif // CRYPTO_SYMMETRIC_KEY_H_ 71 #endif // CRYPTO_SYMMETRIC_KEY_H_
OLDNEW
« no previous file with comments | « crypto/hmac.cc ('k') | crypto/symmetric_key.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698