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_PLATFORM_CRYPTO_H_ | 5 #ifndef CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ |
6 #define CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ | 6 #define CONTENT_CHILD_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 // * |wrapped_key_data| is at least 24 bytes and a multiple of 8 bytes |
189 // * |algorithm.id()| is for a symmetric key algorithm. | 190 // * |algorithm.id()| is for a symmetric key algorithm. |
190 // * |wrapped_key_data| is at least 24 bytes and a multiple of 8 bytes | |
191 Status UnwrapSymKeyAesKw(const CryptoData& wrapped_key_data, | 191 Status UnwrapSymKeyAesKw(const CryptoData& wrapped_key_data, |
192 SymKey* wrapping_key, | 192 SymKey* wrapping_key, |
193 const blink::WebCryptoAlgorithm& algorithm, | 193 const blink::WebCryptoAlgorithm& algorithm, |
194 bool extractable, | 194 bool extractable, |
195 blink::WebCryptoKeyUsageMask usage_mask, | 195 blink::WebCryptoKeyUsageMask usage_mask, |
196 blink::WebCryptoKey* key); | 196 blink::WebCryptoKey* key); |
197 | 197 |
| 198 // Preconditions: |
| 199 // * |wrapping_key| is non-null |
| 200 // * |key| is non-null |
| 201 Status WrapSymKeyRsaEs(PublicKey* wrapping_key, |
| 202 SymKey* key, |
| 203 blink::WebArrayBuffer* buffer); |
| 204 |
| 205 // Preconditions: |
| 206 // * |wrapping_key| is non-null |
| 207 // * |key| is non-null |
| 208 // * |algorithm.id()| is for a symmetric key algorithm. |
| 209 Status UnwrapSymKeyRsaEs(const CryptoData& wrapped_key_data, |
| 210 PrivateKey* wrapping_key, |
| 211 const blink::WebCryptoAlgorithm& algorithm, |
| 212 bool extractable, |
| 213 blink::WebCryptoKeyUsageMask usage_mask, |
| 214 blink::WebCryptoKey* key); |
| 215 |
198 } // namespace platform | 216 } // namespace platform |
199 | 217 |
200 } // namespace webcrypto | 218 } // namespace webcrypto |
201 | 219 |
202 } // namespace content | 220 } // namespace content |
203 | 221 |
204 #endif // CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ | 222 #endif // CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ |
OLD | NEW |