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 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 Loading... |
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 Loading... |
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_ |
OLD | NEW |