| 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 <vector> |
| 8 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 10 #include "third_party/WebKit/public/platform/WebArrayBuffer.h" | 11 #include "third_party/WebKit/public/platform/WebArrayBuffer.h" |
| 11 #include "third_party/WebKit/public/platform/WebCrypto.h" | 12 #include "third_party/WebKit/public/platform/WebCrypto.h" |
| 12 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" | 13 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" |
| 13 | 14 |
| 14 namespace content { | 15 namespace content { |
| 15 | 16 |
| 16 enum EncryptOrDecrypt { ENCRYPT, DECRYPT }; | 17 enum EncryptOrDecrypt { ENCRYPT, DECRYPT }; |
| 17 | 18 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 // Preconditions: | 172 // Preconditions: |
| 172 // * |key| is non-null. | 173 // * |key| is non-null. |
| 173 Status ExportKeyRaw(SymKey* key, blink::WebArrayBuffer* buffer); | 174 Status ExportKeyRaw(SymKey* key, blink::WebArrayBuffer* buffer); |
| 174 | 175 |
| 175 // Preconditions: | 176 // Preconditions: |
| 176 // * |key| is non-null. | 177 // * |key| is non-null. |
| 177 Status ExportKeySpki(PublicKey* key, blink::WebArrayBuffer* buffer); | 178 Status ExportKeySpki(PublicKey* key, blink::WebArrayBuffer* buffer); |
| 178 | 179 |
| 179 // Preconditions: | 180 // Preconditions: |
| 180 // * |key| is non-null. | 181 // * |key| is non-null. |
| 182 Status ExportRsaPublicKey(PublicKey* key, |
| 183 std::vector<uint8>* modulus, |
| 184 std::vector<uint8>* public_exponent); |
| 185 |
| 186 // Preconditions: |
| 187 // * |key| is non-null. |
| 181 Status ExportKeyPkcs8(PrivateKey* key, | 188 Status ExportKeyPkcs8(PrivateKey* key, |
| 182 const blink::WebCryptoKeyAlgorithm& key_algorithm, | 189 const blink::WebCryptoKeyAlgorithm& key_algorithm, |
| 183 blink::WebArrayBuffer* buffer); | 190 blink::WebArrayBuffer* buffer); |
| 184 | 191 |
| 185 // Preconditions: | 192 // Preconditions: |
| 186 // * |wrapping_key| is non-null | 193 // * |wrapping_key| is non-null |
| 187 // * |key| is non-null | 194 // * |key| is non-null |
| 188 Status WrapSymKeyAesKw(SymKey* wrapping_key, | 195 Status WrapSymKeyAesKw(SymKey* wrapping_key, |
| 189 SymKey* key, | 196 SymKey* key, |
| 190 blink::WebArrayBuffer* buffer); | 197 blink::WebArrayBuffer* buffer); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 blink::WebCryptoKeyUsageMask usage_mask, | 241 blink::WebCryptoKeyUsageMask usage_mask, |
| 235 blink::WebCryptoKey* key); | 242 blink::WebCryptoKey* key); |
| 236 | 243 |
| 237 } // namespace platform | 244 } // namespace platform |
| 238 | 245 |
| 239 } // namespace webcrypto | 246 } // namespace webcrypto |
| 240 | 247 |
| 241 } // namespace content | 248 } // namespace content |
| 242 | 249 |
| 243 #endif // CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ | 250 #endif // CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ |
| OLD | NEW |