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

Side by Side Diff: content/child/webcrypto/openssl/rsa_key_openssl.h

Issue 512023002: Refactor the interface for generating keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
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_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
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 blink::WebCryptoKey* public_key,
45 45 blink::WebCryptoKey* private_key) const OVERRIDE;
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 46
54 virtual Status VerifyKeyUsagesBeforeImportKey( 47 virtual Status VerifyKeyUsagesBeforeImportKey(
55 blink::WebCryptoKeyFormat format, 48 blink::WebCryptoKeyFormat format,
56 blink::WebCryptoKeyUsageMask usage_mask) const OVERRIDE; 49 blink::WebCryptoKeyUsageMask usage_mask) const OVERRIDE;
57 50
58 virtual Status ImportKeyPkcs8(const CryptoData& key_data, 51 virtual Status ImportKeyPkcs8(const CryptoData& key_data,
59 const blink::WebCryptoAlgorithm& algorithm, 52 const blink::WebCryptoAlgorithm& algorithm,
60 bool extractable, 53 bool extractable,
61 blink::WebCryptoKeyUsageMask usage_mask, 54 blink::WebCryptoKeyUsageMask usage_mask,
62 blink::WebCryptoKey* key) const OVERRIDE; 55 blink::WebCryptoKey* key) const OVERRIDE;
(...skipping 22 matching lines...) Expand all
85 private: 78 private:
86 blink::WebCryptoKeyUsageMask all_public_key_usages_; 79 blink::WebCryptoKeyUsageMask all_public_key_usages_;
87 blink::WebCryptoKeyUsageMask all_private_key_usages_; 80 blink::WebCryptoKeyUsageMask all_private_key_usages_;
88 }; 81 };
89 82
90 } // namespace webcrypto 83 } // namespace webcrypto
91 84
92 } // namespace content 85 } // namespace content
93 86
94 #endif // CONTENT_CHILD_WEBCRYPTO_OPENSSL_RSA_KEY_OPENSSL_H_ 87 #endif // CONTENT_CHILD_WEBCRYPTO_OPENSSL_RSA_KEY_OPENSSL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698