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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 // Preconditions: | 179 // Preconditions: |
180 // * |wrapping_key| is non-null | 180 // * |wrapping_key| is non-null |
181 // * |key| is non-null | 181 // * |key| is non-null |
182 Status WrapSymKeyAesKw(SymKey* wrapping_key, | 182 Status WrapSymKeyAesKw(SymKey* wrapping_key, |
183 SymKey* key, | 183 SymKey* key, |
184 blink::WebArrayBuffer* buffer); | 184 blink::WebArrayBuffer* buffer); |
185 | 185 |
186 // Preconditions: | 186 // Preconditions: |
187 // * |wrapping_key| is non-null | 187 // * |wrapping_key| is non-null |
188 // * |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 | 189 // * |wrapped_key_data| is at least 24 bytes and a multiple of 8 bytes |
191 Status UnwrapSymKeyAesKw(const CryptoData& wrapped_key_data, | 190 Status UnwrapSymKeyAesKw(const CryptoData& wrapped_key_data, |
192 SymKey* wrapping_key, | 191 SymKey* wrapping_key, |
193 const blink::WebCryptoAlgorithm& algorithm, | 192 const blink::WebCryptoAlgorithm& algorithm, |
194 bool extractable, | 193 bool extractable, |
195 blink::WebCryptoKeyUsageMask usage_mask, | 194 blink::WebCryptoKeyUsageMask usage_mask, |
196 blink::WebCryptoKey* key); | 195 blink::WebCryptoKey* key); |
197 | 196 |
| 197 // Preconditions: |
| 198 // * |wrapping_key| is non-null |
| 199 // * |key| is non-null |
| 200 Status WrapSymKeyRsaEs(PublicKey* wrapping_key, |
| 201 SymKey* key, |
| 202 blink::WebArrayBuffer* buffer); |
| 203 |
| 204 // Preconditions: |
| 205 // * |wrapping_key| is non-null |
| 206 // * |key| is non-null |
| 207 Status UnwrapSymKeyRsaEs(const CryptoData& wrapped_key_data, |
| 208 PrivateKey* wrapping_key, |
| 209 const blink::WebCryptoAlgorithm& algorithm, |
| 210 bool extractable, |
| 211 blink::WebCryptoKeyUsageMask usage_mask, |
| 212 blink::WebCryptoKey* key); |
| 213 |
198 } // namespace platform | 214 } // namespace platform |
199 | 215 |
200 } // namespace webcrypto | 216 } // namespace webcrypto |
201 | 217 |
202 } // namespace content | 218 } // namespace content |
203 | 219 |
204 #endif // CONTENT_RENDERER_WEBCRYPTO_PLATFORM_CRYPTO_H_ | 220 #endif // CONTENT_RENDERER_WEBCRYPTO_PLATFORM_CRYPTO_H_ |
OLD | NEW |