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 <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 const CryptoData& data, | 103 const CryptoData& data, |
104 std::vector<uint8>* buffer); | 104 std::vector<uint8>* buffer); |
105 | 105 |
106 // Preconditions: | 106 // Preconditions: |
107 // * |key| is non-null. | 107 // * |key| is non-null. |
108 Status DecryptRsaEsPkcs1v1_5(PrivateKey* key, | 108 Status DecryptRsaEsPkcs1v1_5(PrivateKey* key, |
109 const CryptoData& data, | 109 const CryptoData& data, |
110 std::vector<uint8>* buffer); | 110 std::vector<uint8>* buffer); |
111 | 111 |
112 // Preconditions: | 112 // Preconditions: |
| 113 // * |key| is non-null |
| 114 // * |hash| is a digest algorithm |
| 115 // * |label| MAY be empty (e.g. 0 bytes long). |
| 116 Status EncryptRsaOaep(PublicKey* key, |
| 117 const blink::WebCryptoAlgorithm& hash, |
| 118 const CryptoData& label, |
| 119 const CryptoData& data, |
| 120 std::vector<uint8>* buffer); |
| 121 |
| 122 // Preconditions: |
| 123 // * |key| is non-null |
| 124 // * |hash| is a digest algorithm |
| 125 // * |label| MAY be empty (e.g. 0 bytes long). |
| 126 Status DecryptRsaOaep(PrivateKey* key, |
| 127 const blink::WebCryptoAlgorithm& hash, |
| 128 const CryptoData& label, |
| 129 const CryptoData& data, |
| 130 std::vector<uint8>* buffer); |
| 131 |
| 132 // Preconditions: |
113 // * |key| is a non-null HMAC key. | 133 // * |key| is a non-null HMAC key. |
114 // * |hash| is a digest algorithm. | 134 // * |hash| is a digest algorithm. |
115 Status SignHmac(SymKey* key, | 135 Status SignHmac(SymKey* key, |
116 const blink::WebCryptoAlgorithm& hash, | 136 const blink::WebCryptoAlgorithm& hash, |
117 const CryptoData& data, | 137 const CryptoData& data, |
118 std::vector<uint8>* buffer); | 138 std::vector<uint8>* buffer); |
119 | 139 |
120 // Preconditions: | 140 // Preconditions: |
121 // * |algorithm| is a SHA function. | 141 // * |algorithm| is a SHA function. |
122 Status DigestSha(blink::WebCryptoAlgorithmId algorithm, | 142 Status DigestSha(blink::WebCryptoAlgorithmId algorithm, |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 blink::WebCryptoKeyUsageMask usage_mask, | 300 blink::WebCryptoKeyUsageMask usage_mask, |
281 blink::WebCryptoKey* key); | 301 blink::WebCryptoKey* key); |
282 | 302 |
283 } // namespace platform | 303 } // namespace platform |
284 | 304 |
285 } // namespace webcrypto | 305 } // namespace webcrypto |
286 | 306 |
287 } // namespace content | 307 } // namespace content |
288 | 308 |
289 #endif // CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ | 309 #endif // CONTENT_CHILD_WEBCRYPTO_PLATFORM_CRYPTO_H_ |
OLD | NEW |