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_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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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. | 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, | 75 bool ContainsKeyUsages(blink::WebCryptoKeyUsageMask a, |
76 blink::WebCryptoKeyUsageMask b); | 76 blink::WebCryptoKeyUsageMask b); |
77 | 77 |
| 78 bool KeyUsageAllows(const blink::WebCryptoKey& key, |
| 79 const blink::WebCryptoKeyUsage usage); |
| 80 |
78 bool IsAlgorithmRsa(blink::WebCryptoAlgorithmId alg_id); | 81 bool IsAlgorithmRsa(blink::WebCryptoAlgorithmId alg_id); |
79 bool IsAlgorithmAsymmetric(blink::WebCryptoAlgorithmId alg_id); | 82 bool IsAlgorithmAsymmetric(blink::WebCryptoAlgorithmId alg_id); |
80 | 83 |
81 } // namespace webcrypto | 84 } // namespace webcrypto |
82 | 85 |
83 } // namespace content | 86 } // namespace content |
84 | 87 |
85 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ | 88 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ |
OLD | NEW |