| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/child/webcrypto/crypto_data.h" | 5 #ifndef CONTENT_CHILD_WEBCRYPTO_NSS_ALGORITHMS_NSS_H_ |
| 6 #define CONTENT_CHILD_WEBCRYPTO_NSS_ALGORITHMS_NSS_H_ |
| 6 | 7 |
| 7 namespace content { | 8 namespace content { |
| 8 | 9 |
| 9 namespace webcrypto { | 10 namespace webcrypto { |
| 10 | 11 |
| 11 CryptoData::CryptoData() : bytes_(NULL), byte_length_(0) {} | 12 class AlgorithmImplementation; |
| 12 | 13 |
| 13 CryptoData::CryptoData(const unsigned char* bytes, unsigned int byte_length) | 14 AlgorithmImplementation* CreateShaImplementation(); |
| 14 : bytes_(bytes), byte_length_(byte_length) {} | 15 AlgorithmImplementation* CreateAesCbcImplementation(); |
| 15 | 16 AlgorithmImplementation* CreateAesGcmImplementation(); |
| 16 CryptoData::CryptoData(const std::vector<unsigned char>& bytes) | 17 AlgorithmImplementation* CreateAesKwImplementation(); |
| 17 : bytes_(bytes.size() ? &bytes[0] : NULL), byte_length_(bytes.size()) {} | 18 AlgorithmImplementation* CreateHmacImplementation(); |
| 18 | 19 AlgorithmImplementation* CreateRsaOaepImplementation(); |
| 19 CryptoData::CryptoData(const std::string& bytes) | 20 AlgorithmImplementation* CreateRsaSsaImplementation(); |
| 20 : bytes_(bytes.size() ? reinterpret_cast<const unsigned char*>(bytes.data()) | |
| 21 : NULL), | |
| 22 byte_length_(bytes.size()) {} | |
| 23 | |
| 24 CryptoData::CryptoData(const blink::WebVector<unsigned char>& bytes) | |
| 25 : bytes_(bytes.data()), byte_length_(bytes.size()) {} | |
| 26 | 21 |
| 27 } // namespace webcrypto | 22 } // namespace webcrypto |
| 28 | 23 |
| 29 } // namespace content | 24 } // namespace content |
| 25 |
| 26 #endif // CONTENT_CHILD_WEBCRYPTO_NSS_ALGORITHMS_NSS_H_ |
| OLD | NEW |