| 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 #ifndef CONTENT_CHILD_WEBCRYPTO_JWK_H_ | 5 #ifndef CONTENT_CHILD_WEBCRYPTO_ALGORITHM_REGISTRY_H_ |
| 6 #define CONTENT_CHILD_WEBCRYPTO_JWK_H_ | 6 #define CONTENT_CHILD_WEBCRYPTO_ALGORITHM_REGISTRY_H_ |
| 7 | 7 |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 #include "third_party/WebKit/public/platform/WebArrayBuffer.h" | |
| 12 #include "third_party/WebKit/public/platform/WebCrypto.h" | 8 #include "third_party/WebKit/public/platform/WebCrypto.h" |
| 13 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" | |
| 14 | 9 |
| 15 namespace content { | 10 namespace content { |
| 16 | 11 |
| 17 namespace webcrypto { | 12 namespace webcrypto { |
| 18 | 13 |
| 19 class CryptoData; | 14 class AlgorithmImplementation; |
| 20 class Status; | 15 class Status; |
| 21 | 16 |
| 22 Status ImportKeyJwk(const CryptoData& key_data, | 17 // Retrieves the AlgorithmImplementation applicable for |id|. |
| 23 const blink::WebCryptoAlgorithm& algorithm, | 18 // |
| 24 bool extractable, | 19 // If there is no available implementation, then an error is returned, and |
| 25 blink::WebCryptoKeyUsageMask usage_mask, | 20 // *impl is set to NULL. |
| 26 blink::WebCryptoKey* key); | 21 // |
| 27 | 22 // Otherwise Success is returned and *impl is set to a non-NULL value. The |
| 28 Status ExportKeyJwk(const blink::WebCryptoKey& key, std::vector<uint8>* buffer); | 23 // AlgorithmImplementation pointer will remain valid until the program's |
| 24 // termination. |
| 25 Status GetAlgorithmImplementation(blink::WebCryptoAlgorithmId id, |
| 26 const AlgorithmImplementation** impl); |
| 29 | 27 |
| 30 } // namespace webcrypto | 28 } // namespace webcrypto |
| 31 | 29 |
| 32 } // namespace content | 30 } // namespace content |
| 33 | 31 |
| 34 #endif // CONTENT_CHILD_WEBCRYPTO_JWK_H_ | 32 #endif // CONTENT_CHILD_WEBCRYPTO_ALGORITHM_REGISTRY_H_ |
| OLD | NEW |