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

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

Issue 282133002: [webcryto] Validate key usages during key creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase on master Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « content/child/webcrypto/webcrypto_impl.cc ('k') | content/child/webcrypto/webcrypto_util.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_WEBCRYPTO_UTIL_H_ 5 #ifndef CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_
6 #define CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ 6 #define CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // Creates an import algorithm for RSA algorithms that take a hash. 64 // Creates an import algorithm for RSA algorithms that take a hash.
65 // It is an error to call this with a hash_id that is not a SHA*. 65 // It is an error to call this with a hash_id that is not a SHA*.
66 CONTENT_EXPORT blink::WebCryptoAlgorithm CreateRsaHashedImportAlgorithm( 66 CONTENT_EXPORT blink::WebCryptoAlgorithm CreateRsaHashedImportAlgorithm(
67 blink::WebCryptoAlgorithmId id, 67 blink::WebCryptoAlgorithmId id,
68 blink::WebCryptoAlgorithmId hash_id); 68 blink::WebCryptoAlgorithmId hash_id);
69 69
70 bool CreateSecretKeyAlgorithm(const blink::WebCryptoAlgorithm& algorithm, 70 bool CreateSecretKeyAlgorithm(const blink::WebCryptoAlgorithm& algorithm,
71 unsigned int keylen_bytes, 71 unsigned int keylen_bytes,
72 blink::WebCryptoKeyAlgorithm* key_algorithm); 72 blink::WebCryptoKeyAlgorithm* key_algorithm);
73 73
74 // Returns true if the set bits in b make up a subset of the set bits in a.
75 bool ContainsKeyUsages(blink::WebCryptoKeyUsageMask a,
76 blink::WebCryptoKeyUsageMask b);
77
74 bool IsAlgorithmRsa(blink::WebCryptoAlgorithmId alg_id); 78 bool IsAlgorithmRsa(blink::WebCryptoAlgorithmId alg_id);
79 bool IsAlgorithmAsymmetric(blink::WebCryptoAlgorithmId alg_id);
75 80
76 } // namespace webcrypto 81 } // namespace webcrypto
77 82
78 } // namespace content 83 } // namespace content
79 84
80 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ 85 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_
OLDNEW
« no previous file with comments | « content/child/webcrypto/webcrypto_impl.cc ('k') | content/child/webcrypto/webcrypto_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698