| 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 GenerateKey(const blink::WebCryptoAlgorithm& algorithm, | 41 Status GenerateKey(const blink::WebCryptoAlgorithm& algorithm, |
| 42 bool extractable, | 42 bool extractable, |
| 43 blink::WebCryptoKeyUsageMask usage_mask, | 43 blink::WebCryptoKeyUsageMask usage_mask, |
| 44 GenerateKeyResult* result) const override; | 44 GenerateKeyResult* result) const override; |
| 45 | 45 |
| 46 virtual Status VerifyKeyUsagesBeforeImportKey( | 46 Status VerifyKeyUsagesBeforeImportKey( |
| 47 blink::WebCryptoKeyFormat format, | 47 blink::WebCryptoKeyFormat format, |
| 48 blink::WebCryptoKeyUsageMask usage_mask) const override; | 48 blink::WebCryptoKeyUsageMask usage_mask) const override; |
| 49 | 49 |
| 50 virtual Status ImportKeyPkcs8(const CryptoData& key_data, | 50 Status ImportKeyPkcs8(const CryptoData& key_data, |
| 51 const blink::WebCryptoAlgorithm& algorithm, | 51 const blink::WebCryptoAlgorithm& algorithm, |
| 52 bool extractable, | 52 bool extractable, |
| 53 blink::WebCryptoKeyUsageMask usage_mask, | 53 blink::WebCryptoKeyUsageMask usage_mask, |
| 54 blink::WebCryptoKey* key) const override; | 54 blink::WebCryptoKey* key) const override; |
| 55 | 55 |
| 56 virtual Status ImportKeySpki(const CryptoData& key_data, | 56 Status ImportKeySpki(const CryptoData& key_data, |
| 57 const blink::WebCryptoAlgorithm& algorithm, | 57 const blink::WebCryptoAlgorithm& algorithm, |
| 58 bool extractable, | 58 bool extractable, |
| 59 blink::WebCryptoKeyUsageMask usage_mask, | 59 blink::WebCryptoKeyUsageMask usage_mask, |
| 60 blink::WebCryptoKey* key) const override; | 60 blink::WebCryptoKey* key) const override; |
| 61 | 61 |
| 62 virtual Status ImportKeyJwk(const CryptoData& key_data, | 62 Status ImportKeyJwk(const CryptoData& key_data, |
| 63 const blink::WebCryptoAlgorithm& algorithm, | 63 const blink::WebCryptoAlgorithm& algorithm, |
| 64 bool extractable, | 64 bool extractable, |
| 65 blink::WebCryptoKeyUsageMask usage_mask, | 65 blink::WebCryptoKeyUsageMask usage_mask, |
| 66 blink::WebCryptoKey* key) const override; | 66 blink::WebCryptoKey* key) const override; |
| 67 | 67 |
| 68 virtual Status ExportKeyPkcs8(const blink::WebCryptoKey& key, | 68 Status ExportKeyPkcs8(const blink::WebCryptoKey& key, |
| 69 std::vector<uint8_t>* buffer) const override; | 69 std::vector<uint8_t>* buffer) const override; |
| 70 | 70 |
| 71 virtual Status ExportKeySpki(const blink::WebCryptoKey& key, | 71 Status ExportKeySpki(const blink::WebCryptoKey& key, |
| 72 std::vector<uint8_t>* buffer) const override; | 72 std::vector<uint8_t>* buffer) const override; |
| 73 | 73 |
| 74 virtual Status ExportKeyJwk(const blink::WebCryptoKey& key, | 74 Status ExportKeyJwk(const blink::WebCryptoKey& key, |
| 75 std::vector<uint8_t>* buffer) const override; | 75 std::vector<uint8_t>* buffer) const override; |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 blink::WebCryptoKeyUsageMask all_public_key_usages_; | 78 blink::WebCryptoKeyUsageMask all_public_key_usages_; |
| 79 blink::WebCryptoKeyUsageMask all_private_key_usages_; | 79 blink::WebCryptoKeyUsageMask all_private_key_usages_; |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 } // namespace webcrypto | 82 } // namespace webcrypto |
| 83 | 83 |
| 84 } // namespace content | 84 } // namespace content |
| 85 | 85 |
| 86 #endif // CONTENT_CHILD_WEBCRYPTO_OPENSSL_RSA_KEY_OPENSSL_H_ | 86 #endif // CONTENT_CHILD_WEBCRYPTO_OPENSSL_RSA_KEY_OPENSSL_H_ |
| OLD | NEW |