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

Side by Side Diff: content/renderer/webcrypto/webcrypto_impl.h

Issue 25906002: [webcrypto] Add JWK import for HMAC and AES-CBC key. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed JWK AES alg key length validation, replaced with TODO Created 7 years, 1 month 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_WEBCRYPTO_IMPL_H_ 5 #ifndef CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_IMPL_H_
6 #define CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_IMPL_H_ 6 #define CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_IMPL_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"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 WebKit::WebCryptoResult result); 55 WebKit::WebCryptoResult result);
56 virtual void verifySignature( 56 virtual void verifySignature(
57 const WebKit::WebCryptoAlgorithm& algorithm, 57 const WebKit::WebCryptoAlgorithm& algorithm,
58 const WebKit::WebCryptoKey& key, 58 const WebKit::WebCryptoKey& key,
59 const unsigned char* signature, 59 const unsigned char* signature,
60 unsigned signature_size, 60 unsigned signature_size,
61 const unsigned char* data, 61 const unsigned char* data,
62 unsigned data_size, 62 unsigned data_size,
63 WebKit::WebCryptoResult result); 63 WebKit::WebCryptoResult result);
64 64
65 static void ShrinkBuffer(WebKit::WebArrayBuffer* buffer, unsigned new_size);
66 static WebKit::WebCryptoKey NullKey(); 65 static WebKit::WebCryptoKey NullKey();
67 66
68 protected: 67 protected:
69 friend class WebCryptoImplTest; 68 friend class WebCryptoImplTest;
70 69
71 void Init(); 70 void Init();
72 71
73 bool EncryptInternal( 72 bool EncryptInternal(
74 const WebKit::WebCryptoAlgorithm& algorithm, 73 const WebKit::WebCryptoAlgorithm& algorithm,
75 const WebKit::WebCryptoKey& key, 74 const WebKit::WebCryptoKey& key,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 WebKit::WebArrayBuffer* buffer); 113 WebKit::WebArrayBuffer* buffer);
115 bool VerifySignatureInternal( 114 bool VerifySignatureInternal(
116 const WebKit::WebCryptoAlgorithm& algorithm, 115 const WebKit::WebCryptoAlgorithm& algorithm,
117 const WebKit::WebCryptoKey& key, 116 const WebKit::WebCryptoKey& key,
118 const unsigned char* signature, 117 const unsigned char* signature,
119 unsigned signature_size, 118 unsigned signature_size,
120 const unsigned char* data, 119 const unsigned char* data,
121 unsigned data_size, 120 unsigned data_size,
122 bool* signature_match); 121 bool* signature_match);
123 122
123 bool ImportKeyJwk(
124 const unsigned char* key_data,
125 unsigned key_data_size,
126 const WebKit::WebCryptoAlgorithm& algorithm_or_null,
127 bool extractable,
128 WebKit::WebCryptoKeyUsageMask usage_mask,
129 WebKit::WebCryptoKey* key);
130
124 private: 131 private:
125 DISALLOW_COPY_AND_ASSIGN(WebCryptoImpl); 132 DISALLOW_COPY_AND_ASSIGN(WebCryptoImpl);
126 }; 133 };
127 134
128 } // namespace content 135 } // namespace content
129 136
130 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_IMPL_H_ 137 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698