Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: content/child/webcrypto/nss/rsa_key_nss.h

Issue 512023002: Refactor the interface for generating keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Run git-cl format Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/child/webcrypto/nss/hmac_nss.cc ('k') | content/child/webcrypto/nss/rsa_key_nss.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_NSS_RSA_KEY_NSS_H_ 5 #ifndef CONTENT_CHILD_WEBCRYPTO_NSS_RSA_KEY_NSS_H_
6 #define CONTENT_CHILD_WEBCRYPTO_NSS_RSA_KEY_NSS_H_ 6 #define CONTENT_CHILD_WEBCRYPTO_NSS_RSA_KEY_NSS_H_
7 7
8 #include <pkcs11t.h> 8 #include <pkcs11t.h>
9 9
10 #include "content/child/webcrypto/algorithm_implementation.h" 10 #include "content/child/webcrypto/algorithm_implementation.h"
(...skipping 25 matching lines...) Expand all
36 blink::WebCryptoKeyUsageMask all_public_key_usages, 36 blink::WebCryptoKeyUsageMask all_public_key_usages,
37 blink::WebCryptoKeyUsageMask all_private_key_usages) 37 blink::WebCryptoKeyUsageMask all_private_key_usages)
38 : generate_flags_(generate_flags), 38 : generate_flags_(generate_flags),
39 all_public_key_usages_(all_public_key_usages), 39 all_public_key_usages_(all_public_key_usages),
40 all_private_key_usages_(all_private_key_usages) {} 40 all_private_key_usages_(all_private_key_usages) {}
41 41
42 // For instance "RSA-OAEP-256". 42 // For instance "RSA-OAEP-256".
43 virtual const char* GetJwkAlgorithm( 43 virtual const char* GetJwkAlgorithm(
44 const blink::WebCryptoAlgorithmId hash) const = 0; 44 const blink::WebCryptoAlgorithmId hash) const = 0;
45 45
46 virtual Status VerifyKeyUsagesBeforeGenerateKeyPair( 46 virtual Status GenerateKey(const blink::WebCryptoAlgorithm& algorithm,
47 blink::WebCryptoKeyUsageMask combined_usage_mask, 47 bool extractable,
48 blink::WebCryptoKeyUsageMask* public_usage_mask, 48 blink::WebCryptoKeyUsageMask usage_mask,
49 blink::WebCryptoKeyUsageMask* private_usage_mask) const override; 49 GenerateKeyResult* result) const override;
50
51 virtual Status GenerateKeyPair(
52 const blink::WebCryptoAlgorithm& algorithm,
53 bool extractable,
54 blink::WebCryptoKeyUsageMask public_usage_mask,
55 blink::WebCryptoKeyUsageMask private_usage_mask,
56 blink::WebCryptoKey* public_key,
57 blink::WebCryptoKey* private_key) const override;
58 50
59 virtual Status VerifyKeyUsagesBeforeImportKey( 51 virtual Status VerifyKeyUsagesBeforeImportKey(
60 blink::WebCryptoKeyFormat format, 52 blink::WebCryptoKeyFormat format,
61 blink::WebCryptoKeyUsageMask usage_mask) const override; 53 blink::WebCryptoKeyUsageMask usage_mask) const override;
62 54
63 virtual Status ImportKeyPkcs8(const CryptoData& key_data, 55 virtual Status ImportKeyPkcs8(const CryptoData& key_data,
64 const blink::WebCryptoAlgorithm& algorithm, 56 const blink::WebCryptoAlgorithm& algorithm,
65 bool extractable, 57 bool extractable,
66 blink::WebCryptoKeyUsageMask usage_mask, 58 blink::WebCryptoKeyUsageMask usage_mask,
67 blink::WebCryptoKey* key) const override; 59 blink::WebCryptoKey* key) const override;
(...skipping 23 matching lines...) Expand all
91 CK_FLAGS generate_flags_; 83 CK_FLAGS generate_flags_;
92 blink::WebCryptoKeyUsageMask all_public_key_usages_; 84 blink::WebCryptoKeyUsageMask all_public_key_usages_;
93 blink::WebCryptoKeyUsageMask all_private_key_usages_; 85 blink::WebCryptoKeyUsageMask all_private_key_usages_;
94 }; 86 };
95 87
96 } // namespace webcrypto 88 } // namespace webcrypto
97 89
98 } // namespace content 90 } // namespace content
99 91
100 #endif // CONTENT_CHILD_WEBCRYPTO_NSS_RSA_KEY_NSS_H_ 92 #endif // CONTENT_CHILD_WEBCRYPTO_NSS_RSA_KEY_NSS_H_
OLDNEW
« no previous file with comments | « content/child/webcrypto/nss/hmac_nss.cc ('k') | content/child/webcrypto/nss/rsa_key_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698