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_OPENSSL_RSA_KEY_OPENSSL_H_ | 5 #ifndef CONTENT_CHILD_WEBCRYPTO_OPENSSL_RSA_KEY_OPENSSL_H_ |
6 #define CONTENT_CHILD_WEBCRYPTO_OPENSSL_RSA_KEY_OPENSSL_H_ | 6 #define CONTENT_CHILD_WEBCRYPTO_OPENSSL_RSA_KEY_OPENSSL_H_ |
7 | 7 |
8 #include "content/child/webcrypto/algorithm_implementation.h" | 8 #include "content/child/webcrypto/algorithm_implementation.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
(...skipping 20 matching lines...) Expand all Loading... |
31 // that valid key usages are allowed. | 31 // that valid key usages are allowed. |
32 RsaHashedAlgorithm(blink::WebCryptoKeyUsageMask all_public_key_usages, | 32 RsaHashedAlgorithm(blink::WebCryptoKeyUsageMask all_public_key_usages, |
33 blink::WebCryptoKeyUsageMask all_private_key_usages) | 33 blink::WebCryptoKeyUsageMask all_private_key_usages) |
34 : all_public_key_usages_(all_public_key_usages), | 34 : all_public_key_usages_(all_public_key_usages), |
35 all_private_key_usages_(all_private_key_usages) {} | 35 all_private_key_usages_(all_private_key_usages) {} |
36 | 36 |
37 // For instance "RSA-OAEP-256". | 37 // For instance "RSA-OAEP-256". |
38 virtual const char* GetJwkAlgorithm( | 38 virtual const char* GetJwkAlgorithm( |
39 const blink::WebCryptoAlgorithmId hash) const = 0; | 39 const blink::WebCryptoAlgorithmId hash) const = 0; |
40 | 40 |
41 virtual Status VerifyKeyUsagesBeforeGenerateKeyPair( | 41 virtual Status GenerateKey(const blink::WebCryptoAlgorithm& algorithm, |
42 blink::WebCryptoKeyUsageMask combined_usage_mask, | 42 bool extractable, |
43 blink::WebCryptoKeyUsageMask* public_usage_mask, | 43 blink::WebCryptoKeyUsageMask usage_mask, |
44 blink::WebCryptoKeyUsageMask* private_usage_mask) const override; | 44 GenerateKeyResult* result) const override; |
45 | |
46 virtual Status GenerateKeyPair( | |
47 const blink::WebCryptoAlgorithm& algorithm, | |
48 bool extractable, | |
49 blink::WebCryptoKeyUsageMask public_usage_mask, | |
50 blink::WebCryptoKeyUsageMask private_usage_mask, | |
51 blink::WebCryptoKey* public_key, | |
52 blink::WebCryptoKey* private_key) const override; | |
53 | 45 |
54 virtual Status VerifyKeyUsagesBeforeImportKey( | 46 virtual Status VerifyKeyUsagesBeforeImportKey( |
55 blink::WebCryptoKeyFormat format, | 47 blink::WebCryptoKeyFormat format, |
56 blink::WebCryptoKeyUsageMask usage_mask) const override; | 48 blink::WebCryptoKeyUsageMask usage_mask) const override; |
57 | 49 |
58 virtual Status ImportKeyPkcs8(const CryptoData& key_data, | 50 virtual Status ImportKeyPkcs8(const CryptoData& key_data, |
59 const blink::WebCryptoAlgorithm& algorithm, | 51 const blink::WebCryptoAlgorithm& algorithm, |
60 bool extractable, | 52 bool extractable, |
61 blink::WebCryptoKeyUsageMask usage_mask, | 53 blink::WebCryptoKeyUsageMask usage_mask, |
62 blink::WebCryptoKey* key) const override; | 54 blink::WebCryptoKey* key) const override; |
(...skipping 22 matching lines...) Expand all Loading... |
85 private: | 77 private: |
86 blink::WebCryptoKeyUsageMask all_public_key_usages_; | 78 blink::WebCryptoKeyUsageMask all_public_key_usages_; |
87 blink::WebCryptoKeyUsageMask all_private_key_usages_; | 79 blink::WebCryptoKeyUsageMask all_private_key_usages_; |
88 }; | 80 }; |
89 | 81 |
90 } // namespace webcrypto | 82 } // namespace webcrypto |
91 | 83 |
92 } // namespace content | 84 } // namespace content |
93 | 85 |
94 #endif // CONTENT_CHILD_WEBCRYPTO_OPENSSL_RSA_KEY_OPENSSL_H_ | 86 #endif // CONTENT_CHILD_WEBCRYPTO_OPENSSL_RSA_KEY_OPENSSL_H_ |
OLD | NEW |