Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_CHILD_WEBCRYPTO_NSS_RSA_KEY_NSS_H_ | |
| 6 #define CONTENT_CHILD_WEBCRYPTO_NSS_RSA_KEY_NSS_H_ | |
| 7 | |
| 8 #include <pkcs11t.h> | |
| 9 | |
| 10 #include "content/child/webcrypto/algorithm_implementation.h" | |
| 11 | |
| 12 namespace content { | |
| 13 | |
| 14 namespace webcrypto { | |
| 15 | |
| 16 class PublicKeyNss; | |
| 17 class PrivateKeyNss; | |
| 18 | |
| 19 class RsaHashedAlgorithm : public AlgorithmImplementation { | |
| 20 public: | |
| 21 RsaHashedAlgorithm(CK_FLAGS generate_flags, | |
| 22 blink::WebCryptoKeyUsageMask all_public_key_usages, | |
| 23 blink::WebCryptoKeyUsageMask all_private_key_usages) | |
|
Ryan Sleevi
2014/07/17 00:06:54
Document
eroman
2014/07/17 20:37:26
Done. I documented the class as:
// Base class fo
| |
| 24 : generate_flags_(generate_flags), | |
| 25 all_public_key_usages_(all_public_key_usages), | |
| 26 all_private_key_usages_(all_private_key_usages) {} | |
| 27 | |
| 28 // For instance "RSA-OAEP-256". | |
| 29 virtual const char* GetJwkAlgorithm( | |
| 30 const blink::WebCryptoAlgorithmId hash) const = 0; | |
| 31 | |
| 32 virtual Status VerifyKeyUsagesBeforeGenerateKeyPair( | |
| 33 blink::WebCryptoKeyUsageMask combined_usage_mask, | |
| 34 blink::WebCryptoKeyUsageMask* public_usage_mask, | |
| 35 blink::WebCryptoKeyUsageMask* private_usage_mask) const OVERRIDE; | |
| 36 | |
| 37 virtual Status GenerateKeyPair( | |
| 38 const blink::WebCryptoAlgorithm& algorithm, | |
| 39 bool extractable, | |
| 40 blink::WebCryptoKeyUsageMask public_usage_mask, | |
| 41 blink::WebCryptoKeyUsageMask private_usage_mask, | |
| 42 blink::WebCryptoKey* public_key, | |
| 43 blink::WebCryptoKey* private_key) const OVERRIDE; | |
| 44 | |
| 45 virtual Status VerifyKeyUsagesBeforeImportKey( | |
| 46 blink::WebCryptoKeyFormat format, | |
| 47 blink::WebCryptoKeyUsageMask usage_mask) const OVERRIDE; | |
| 48 | |
| 49 virtual Status ImportKeyPkcs8(const CryptoData& key_data, | |
| 50 const blink::WebCryptoAlgorithm& algorithm, | |
| 51 bool extractable, | |
| 52 blink::WebCryptoKeyUsageMask usage_mask, | |
| 53 blink::WebCryptoKey* key) const OVERRIDE; | |
| 54 | |
| 55 virtual Status ImportKeySpki(const CryptoData& key_data, | |
| 56 const blink::WebCryptoAlgorithm& algorithm, | |
| 57 bool extractable, | |
| 58 blink::WebCryptoKeyUsageMask usage_mask, | |
| 59 blink::WebCryptoKey* key) const OVERRIDE; | |
| 60 | |
| 61 virtual Status ExportKeyPkcs8(const blink::WebCryptoKey& key, | |
| 62 std::vector<uint8>* buffer) const OVERRIDE; | |
| 63 | |
| 64 virtual Status ExportKeySpki(const blink::WebCryptoKey& key, | |
| 65 std::vector<uint8>* buffer) const OVERRIDE; | |
| 66 | |
| 67 virtual Status ImportKeyJwk(const CryptoData& key_data, | |
| 68 const blink::WebCryptoAlgorithm& algorithm, | |
| 69 bool extractable, | |
| 70 blink::WebCryptoKeyUsageMask usage_mask, | |
| 71 blink::WebCryptoKey* key) const OVERRIDE; | |
| 72 | |
| 73 virtual Status ExportKeyJwk(const blink::WebCryptoKey& key, | |
| 74 std::vector<uint8>* buffer) const OVERRIDE; | |
| 75 | |
| 76 private: | |
| 77 CK_FLAGS generate_flags_; | |
| 78 blink::WebCryptoKeyUsageMask all_public_key_usages_; | |
| 79 blink::WebCryptoKeyUsageMask all_private_key_usages_; | |
| 80 }; | |
| 81 | |
| 82 } // namespace webcrypto | |
| 83 | |
| 84 } // namespace content | |
| 85 | |
| 86 #endif // CONTENT_CHILD_WEBCRYPTO_NSS_RSA_KEY_NSS_H_ | |
| OLD | NEW |