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

Side by Side Diff: components/webcrypto/webcrypto_util.h

Issue 1181413009: move KeyUsageAllows to more logical place(part2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove AUTHORS change because name is already there Created 5 years, 4 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 | « components/webcrypto/algorithm_dispatch.cc ('k') | components/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 COMPONENTS_WEBCRYPTO_WEBCRYPTO_UTIL_H_ 5 #ifndef COMPONENTS_WEBCRYPTO_WEBCRYPTO_UTIL_H_
6 #define COMPONENTS_WEBCRYPTO_WEBCRYPTO_UTIL_H_ 6 #define COMPONENTS_WEBCRYPTO_WEBCRYPTO_UTIL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string> 9 #include <string>
10 10
(...skipping 27 matching lines...) Expand all
38 38
39 // Creates an import algorithm for EC keys. 39 // Creates an import algorithm for EC keys.
40 blink::WebCryptoAlgorithm CreateEcImportAlgorithm( 40 blink::WebCryptoAlgorithm CreateEcImportAlgorithm(
41 blink::WebCryptoAlgorithmId id, 41 blink::WebCryptoAlgorithmId id,
42 blink::WebCryptoNamedCurve named_curve); 42 blink::WebCryptoNamedCurve named_curve);
43 43
44 // Returns true if the set bits in b make up a subset of the set bits in a. 44 // Returns true if the set bits in b make up a subset of the set bits in a.
45 bool ContainsKeyUsages(blink::WebCryptoKeyUsageMask a, 45 bool ContainsKeyUsages(blink::WebCryptoKeyUsageMask a,
46 blink::WebCryptoKeyUsageMask b); 46 blink::WebCryptoKeyUsageMask b);
47 47
48 bool KeyUsageAllows(const blink::WebCryptoKey& key,
49 const blink::WebCryptoKeyUsage usage);
50
51 Status GetAesGcmTagLengthInBits(const blink::WebCryptoAesGcmParams* params, 48 Status GetAesGcmTagLengthInBits(const blink::WebCryptoAesGcmParams* params,
52 unsigned int* tag_length_bits); 49 unsigned int* tag_length_bits);
53 50
54 Status GetAesKeyGenLengthInBits(const blink::WebCryptoAesKeyGenParams* params, 51 Status GetAesKeyGenLengthInBits(const blink::WebCryptoAesKeyGenParams* params,
55 unsigned int* keylen_bits); 52 unsigned int* keylen_bits);
56 53
57 Status GetHmacKeyGenLengthInBits(const blink::WebCryptoHmacKeyGenParams* params, 54 Status GetHmacKeyGenLengthInBits(const blink::WebCryptoHmacKeyGenParams* params,
58 unsigned int* keylen_bits); 55 unsigned int* keylen_bits);
59 56
60 // Gets the requested key length in bits for an HMAC import operation. 57 // Gets the requested key length in bits for an HMAC import operation.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 Status GetUsagesForGenerateAsymmetricKey( 121 Status GetUsagesForGenerateAsymmetricKey(
125 blink::WebCryptoKeyUsageMask combined_usages, 122 blink::WebCryptoKeyUsageMask combined_usages,
126 blink::WebCryptoKeyUsageMask all_public_usages, 123 blink::WebCryptoKeyUsageMask all_public_usages,
127 blink::WebCryptoKeyUsageMask all_private_usages, 124 blink::WebCryptoKeyUsageMask all_private_usages,
128 blink::WebCryptoKeyUsageMask* public_usages, 125 blink::WebCryptoKeyUsageMask* public_usages,
129 blink::WebCryptoKeyUsageMask* private_usages); 126 blink::WebCryptoKeyUsageMask* private_usages);
130 127
131 } // namespace webcrypto 128 } // namespace webcrypto
132 129
133 #endif // COMPONENTS_WEBCRYPTO_WEBCRYPTO_UTIL_H_ 130 #endif // COMPONENTS_WEBCRYPTO_WEBCRYPTO_UTIL_H_
OLDNEW
« no previous file with comments | « components/webcrypto/algorithm_dispatch.cc ('k') | components/webcrypto/webcrypto_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698