| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_ |
| OLD | NEW |