| OLD | NEW |
| 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 #include "crypto/symmetric_key.h" | 5 #include "crypto/symmetric_key.h" |
| 6 | 6 |
| 7 #include <openssl/evp.h> | 7 #include <openssl/evp.h> |
| 8 #include <openssl/rand.h> | 8 #include <openssl/rand.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 } | 65 } |
| 66 | 66 |
| 67 // static | 67 // static |
| 68 SymmetricKey* SymmetricKey::Import(Algorithm algorithm, | 68 SymmetricKey* SymmetricKey::Import(Algorithm algorithm, |
| 69 const std::string& raw_key) { | 69 const std::string& raw_key) { |
| 70 scoped_ptr<SymmetricKey> key(new SymmetricKey); | 70 scoped_ptr<SymmetricKey> key(new SymmetricKey); |
| 71 key->key_ = raw_key; | 71 key->key_ = raw_key; |
| 72 return key.release(); | 72 return key.release(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 bool SymmetricKey::GetRawKey(std::string* raw_key) { | 75 bool SymmetricKey::GetRawKey(std::string* raw_key) const { |
| 76 *raw_key = key_; | 76 *raw_key = key_; |
| 77 return true; | 77 return true; |
| 78 } | 78 } |
| 79 | 79 |
| 80 } // namespace crypto | 80 } // namespace crypto |
| OLD | NEW |