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

Side by Side Diff: crypto/symmetric_key.h

Issue 8949056: This adds support for encrypted ONC import (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Handling decryption errors better Created 8 years, 11 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
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 PK11SymKey* key() const { return key_.get(); } 63 PK11SymKey* key() const { return key_.get(); }
64 #elif defined(OS_MACOSX) 64 #elif defined(OS_MACOSX)
65 CSSM_DATA cssm_data() const; 65 CSSM_DATA cssm_data() const;
66 #elif defined(OS_WIN) 66 #elif defined(OS_WIN)
67 HCRYPTKEY key() const { return key_.get(); } 67 HCRYPTKEY key() const { return key_.get(); }
68 #endif 68 #endif
69 69
70 // Extracts the raw key from the platform specific data. 70 // Extracts the raw key from the platform specific data.
71 // Warning: |raw_key| holds the raw key as bytes and thus must be handled 71 // Warning: |raw_key| holds the raw key as bytes and thus must be handled
72 // carefully. 72 // carefully.
73 bool GetRawKey(std::string* raw_key); 73 bool GetRawKey(std::string* raw_key) const;
Ryan Sleevi 2012/01/04 01:33:43 This isn't a const operation on Windows, at least
Greg Spencer (Chromium) 2012/01/05 22:18:03 Crap. OK, I'll change the constness of the argume
74 74
75 #if defined(OS_CHROMEOS) 75 #if defined(OS_CHROMEOS)
76 // Creates symmetric key from NSS key. Takes over the ownership of |key|. 76 // Creates symmetric key from NSS key. Takes over the ownership of |key|.
77 static SymmetricKey* CreateFromKey(PK11SymKey* key); 77 static SymmetricKey* CreateFromKey(PK11SymKey* key);
78 #endif 78 #endif
79 79
80 private: 80 private:
81 #if defined(USE_OPENSSL) 81 #if defined(USE_OPENSSL)
82 SymmetricKey() {} 82 SymmetricKey() {}
83 std::string key_; 83 std::string key_;
(...skipping 18 matching lines...) Expand all
102 // fails with NTE_BAD_KEY/NTE_BAD_LEN 102 // fails with NTE_BAD_KEY/NTE_BAD_LEN
103 std::string raw_key_; 103 std::string raw_key_;
104 #endif 104 #endif
105 105
106 DISALLOW_COPY_AND_ASSIGN(SymmetricKey); 106 DISALLOW_COPY_AND_ASSIGN(SymmetricKey);
107 }; 107 };
108 108
109 } // namespace crypto 109 } // namespace crypto
110 110
111 #endif // CRYPTO_SYMMETRIC_KEY_H_ 111 #endif // CRYPTO_SYMMETRIC_KEY_H_
OLDNEW
« crypto/hmac.cc ('K') | « crypto/hmac.cc ('k') | crypto/symmetric_key_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698