Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: content/child/webcrypto/shared_crypto.h

Issue 211943002: [webcrypto] Minor cleanup/consolidation of JWK source. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes for eroman Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/child/webcrypto/jwk.cc ('k') | content/child/webcrypto/shared_crypto.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_SHARED_CRYPTO_H_ 5 #ifndef CONTENT_CHILD_WEBCRYPTO_SHARED_CRYPTO_H_
6 #define CONTENT_CHILD_WEBCRYPTO_SHARED_CRYPTO_H_ 6 #define CONTENT_CHILD_WEBCRYPTO_SHARED_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 "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 #include "third_party/WebKit/public/platform/WebArrayBuffer.h" 11 #include "third_party/WebKit/public/platform/WebArrayBuffer.h"
12 #include "third_party/WebKit/public/platform/WebCrypto.h" 12 #include "third_party/WebKit/public/platform/WebCrypto.h"
13 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" 13 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h"
14 14
15 namespace content { 15 namespace content {
16 16
17 namespace webcrypto { 17 namespace webcrypto {
18 18
19 class CryptoData; 19 class CryptoData;
20
eroman 2014/03/26 00:10:37 hah! you were just copy pasting my mistake :)
21 class Status; 20 class Status;
22 21
23 // Do one-time initialization. It is safe to call this multiple times. 22 // Do one-time initialization. It is safe to call this multiple times.
24 CONTENT_EXPORT void Init(); 23 CONTENT_EXPORT void Init();
25 24
26 // The functions exported by shared_crypto.h provide a common entry point for 25 // The functions exported by shared_crypto.h provide a common entry point for
27 // synchronous crypto operations. 26 // synchronous crypto operations.
28 // 27 //
29 // Here is how the layer cake looks. 28 // Here is how the layer cake looks.
30 // 29 //
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 const CryptoData& data, 115 const CryptoData& data,
117 blink::WebArrayBuffer* buffer); 116 blink::WebArrayBuffer* buffer);
118 117
119 CONTENT_EXPORT Status 118 CONTENT_EXPORT Status
120 VerifySignature(const blink::WebCryptoAlgorithm& algorithm, 119 VerifySignature(const blink::WebCryptoAlgorithm& algorithm,
121 const blink::WebCryptoKey& key, 120 const blink::WebCryptoKey& key,
122 const CryptoData& signature, 121 const CryptoData& signature,
123 const CryptoData& data, 122 const CryptoData& data,
124 bool* signature_match); 123 bool* signature_match);
125 124
126 CONTENT_EXPORT Status ImportKeyJwk(const CryptoData& key_data,
127 const blink::WebCryptoAlgorithm& algorithm,
128 bool extractable,
129 blink::WebCryptoKeyUsageMask usage_mask,
130 blink::WebCryptoKey* key);
131
132 CONTENT_EXPORT Status
133 ExportKeyJwk(const blink::WebCryptoKey& key, blink::WebArrayBuffer* buffer);
134
135 CONTENT_EXPORT Status 125 CONTENT_EXPORT Status
136 WrapKey(blink::WebCryptoKeyFormat format, 126 WrapKey(blink::WebCryptoKeyFormat format,
137 const blink::WebCryptoKey& wrapping_key, 127 const blink::WebCryptoKey& wrapping_key,
138 const blink::WebCryptoKey& key_to_wrap, 128 const blink::WebCryptoKey& key_to_wrap,
139 const blink::WebCryptoAlgorithm& wrapping_algorithm, 129 const blink::WebCryptoAlgorithm& wrapping_algorithm,
140 blink::WebArrayBuffer* buffer); 130 blink::WebArrayBuffer* buffer);
141 131
142 CONTENT_EXPORT Status 132 CONTENT_EXPORT Status
143 UnwrapKey(blink::WebCryptoKeyFormat format, 133 UnwrapKey(blink::WebCryptoKeyFormat format,
144 const CryptoData& wrapped_key_data, 134 const CryptoData& wrapped_key_data,
(...skipping 14 matching lines...) Expand all
159 bool extractable, 149 bool extractable,
160 blink::WebCryptoKeyUsageMask usage_mask, 150 blink::WebCryptoKeyUsageMask usage_mask,
161 const CryptoData& key_data, 151 const CryptoData& key_data,
162 blink::WebCryptoKey* key); 152 blink::WebCryptoKey* key);
163 153
164 } // namespace webcrypto 154 } // namespace webcrypto
165 155
166 } // namespace content 156 } // namespace content
167 157
168 #endif // CONTENT_CHILD_WEBCRYPTO_SHARED_CRYPTO_H_ 158 #endif // CONTENT_CHILD_WEBCRYPTO_SHARED_CRYPTO_H_
OLDNEW
« no previous file with comments | « content/child/webcrypto/jwk.cc ('k') | content/child/webcrypto/shared_crypto.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698