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_WEBCRYPTO_IMPL_H_ | 5 #ifndef CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_IMPL_H_ |
6 #define CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_IMPL_H_ | 6 #define CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "third_party/WebKit/public/platform/WebCrypto.h" | 10 #include "third_party/WebKit/public/platform/WebCrypto.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 const blink::WebCryptoAlgorithm& unwrapped_key_algorithm, | 82 const blink::WebCryptoAlgorithm& unwrapped_key_algorithm, |
83 bool extractable, | 83 bool extractable, |
84 blink::WebCryptoKeyUsageMask usages, | 84 blink::WebCryptoKeyUsageMask usages, |
85 blink::WebCryptoResult result); | 85 blink::WebCryptoResult result); |
86 | 86 |
87 virtual void deriveBits(const blink::WebCryptoAlgorithm& algorithm, | 87 virtual void deriveBits(const blink::WebCryptoAlgorithm& algorithm, |
88 const blink::WebCryptoKey& base_key, | 88 const blink::WebCryptoKey& base_key, |
89 unsigned int length_bits, | 89 unsigned int length_bits, |
90 blink::WebCryptoResult result); | 90 blink::WebCryptoResult result); |
91 | 91 |
| 92 virtual void deriveKey(const blink::WebCryptoAlgorithm& algorithm, |
| 93 const blink::WebCryptoKey& base_key, |
| 94 const blink::WebCryptoAlgorithm& import_algorithm, |
| 95 const blink::WebCryptoAlgorithm& key_length_algorithm, |
| 96 bool extractable, |
| 97 blink::WebCryptoKeyUsageMask usages, |
| 98 blink::WebCryptoResult result); |
| 99 |
92 // This method returns a digestor object that can be used to synchronously | 100 // This method returns a digestor object that can be used to synchronously |
93 // compute a digest one chunk at a time. Thus, the consume does not need to | 101 // compute a digest one chunk at a time. Thus, the consume does not need to |
94 // hold onto a large buffer with all the data to digest. Chunks can be given | 102 // hold onto a large buffer with all the data to digest. Chunks can be given |
95 // one at a time and the digest will be computed piecemeal. The allocated | 103 // one at a time and the digest will be computed piecemeal. The allocated |
96 // WebCrytpoDigestor that is returned by createDigestor must be freed by the | 104 // WebCrytpoDigestor that is returned by createDigestor must be freed by the |
97 // caller. | 105 // caller. |
98 virtual blink::WebCryptoDigestor* createDigestor( | 106 virtual blink::WebCryptoDigestor* createDigestor( |
99 blink::WebCryptoAlgorithmId algorithm_id); | 107 blink::WebCryptoAlgorithmId algorithm_id); |
100 | 108 |
101 virtual bool deserializeKeyForClone( | 109 virtual bool deserializeKeyForClone( |
102 const blink::WebCryptoKeyAlgorithm& algorithm, | 110 const blink::WebCryptoKeyAlgorithm& algorithm, |
103 blink::WebCryptoKeyType type, | 111 blink::WebCryptoKeyType type, |
104 bool extractable, | 112 bool extractable, |
105 blink::WebCryptoKeyUsageMask usages, | 113 blink::WebCryptoKeyUsageMask usages, |
106 const unsigned char* key_data, | 114 const unsigned char* key_data, |
107 unsigned key_data_size, | 115 unsigned key_data_size, |
108 blink::WebCryptoKey& key); | 116 blink::WebCryptoKey& key); |
109 | 117 |
110 virtual bool serializeKeyForClone(const blink::WebCryptoKey& key, | 118 virtual bool serializeKeyForClone(const blink::WebCryptoKey& key, |
111 blink::WebVector<unsigned char>& key_data); | 119 blink::WebVector<unsigned char>& key_data); |
112 | 120 |
113 private: | 121 private: |
114 DISALLOW_COPY_AND_ASSIGN(WebCryptoImpl); | 122 DISALLOW_COPY_AND_ASSIGN(WebCryptoImpl); |
115 }; | 123 }; |
116 | 124 |
117 } // namespace content | 125 } // namespace content |
118 | 126 |
119 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_IMPL_H_ | 127 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_IMPL_H_ |
OLD | NEW |