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_RENDERER_WEBCRYPTO_PLATFORM_CRYPTO_H_ | 5 #ifndef CONTENT_RENDERER_WEBCRYPTO_PLATFORM_CRYPTO_H_ |
6 #define CONTENT_RENDERER_WEBCRYPTO_PLATFORM_CRYPTO_H_ | 6 #define CONTENT_RENDERER_WEBCRYPTO_PLATFORM_CRYPTO_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/WebArrayBuffer.h" | 10 #include "third_party/WebKit/public/platform/WebArrayBuffer.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
169 blink::WebCryptoKey* key); | 169 blink::WebCryptoKey* key); |
170 | 170 |
171 // Preconditions: | 171 // Preconditions: |
172 // * |key| is non-null. | 172 // * |key| is non-null. |
173 Status ExportKeyRaw(SymKey* key, blink::WebArrayBuffer* buffer); | 173 Status ExportKeyRaw(SymKey* key, blink::WebArrayBuffer* buffer); |
174 | 174 |
175 // Preconditions: | 175 // Preconditions: |
176 // * |key| is non-null. | 176 // * |key| is non-null. |
177 Status ExportKeySpki(PublicKey* key, blink::WebArrayBuffer* buffer); | 177 Status ExportKeySpki(PublicKey* key, blink::WebArrayBuffer* buffer); |
178 | 178 |
179 // Preconditions: | |
180 // * |wrapping_key| is non-null | |
181 // * |key| is non-null | |
182 Status WrapSymKeyAesKw(SymKey* wrapping_key, | |
183 SymKey* key, | |
184 blink::WebArrayBuffer* buffer); | |
185 | |
186 // Preconditions: | |
187 // * |wrapping_key| is non-null | |
188 // * |key| is non-null | |
189 // * |algorithm.id()| is for a symmetric key algorithm. | |
190 // * |wrapped_key_data| is at least 24 bytes and a multiple of 8 bytes | |
eroman
2014/03/01 01:13:54
This is not currently guranteed as the checks are
padolph
2014/03/01 01:55:01
Done.
| |
191 Status UnwrapSymKeyAesKw(const CryptoData& wrapped_key_data, | |
192 SymKey* wrapping_key, | |
193 const blink::WebCryptoAlgorithm& algorithm, | |
194 bool extractable, | |
195 blink::WebCryptoKeyUsageMask usage_mask, | |
196 blink::WebCryptoKey* key); | |
197 | |
179 } // namespace platform | 198 } // namespace platform |
180 | 199 |
181 } // namespace webcrypto | 200 } // namespace webcrypto |
182 | 201 |
183 } // namespace content | 202 } // namespace content |
184 | 203 |
185 #endif // CONTENT_RENDERER_WEBCRYPTO_PLATFORM_CRYPTO_H_ | 204 #endif // CONTENT_RENDERER_WEBCRYPTO_PLATFORM_CRYPTO_H_ |
OLD | NEW |