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

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

Issue 401363002: [webcrypto] Add OpenSSL implementation of RSA key generation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase onto master Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/child/webcrypto/openssl/rsa_key_openssl.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_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 16 matching lines...) Expand all
27 // keys support decryption and unwrapping callers should set: 27 // keys support decryption and unwrapping callers should set:
28 // all_public_key_usages = UsageEncrypt | UsageWrap 28 // all_public_key_usages = UsageEncrypt | UsageWrap
29 // all_private_key_usages = UsageDecrypt | UsageUnwrap 29 // all_private_key_usages = UsageDecrypt | UsageUnwrap
30 // This information is used when importing or generating keys, to enforce 30 // This information is used when importing or generating keys, to enforce
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 virtual Status VerifyKeyUsagesBeforeGenerateKeyPair(
38 blink::WebCryptoKeyUsageMask combined_usage_mask,
39 blink::WebCryptoKeyUsageMask* public_usage_mask,
40 blink::WebCryptoKeyUsageMask* private_usage_mask) const OVERRIDE;
41
42 virtual Status GenerateKeyPair(
43 const blink::WebCryptoAlgorithm& algorithm,
44 bool extractable,
45 blink::WebCryptoKeyUsageMask public_usage_mask,
46 blink::WebCryptoKeyUsageMask private_usage_mask,
47 blink::WebCryptoKey* public_key,
48 blink::WebCryptoKey* private_key) const OVERRIDE;
49
37 virtual Status VerifyKeyUsagesBeforeImportKey( 50 virtual Status VerifyKeyUsagesBeforeImportKey(
38 blink::WebCryptoKeyFormat format, 51 blink::WebCryptoKeyFormat format,
39 blink::WebCryptoKeyUsageMask usage_mask) const OVERRIDE; 52 blink::WebCryptoKeyUsageMask usage_mask) const OVERRIDE;
40 53
41 virtual Status ImportKeyPkcs8(const CryptoData& key_data, 54 virtual Status ImportKeyPkcs8(const CryptoData& key_data,
42 const blink::WebCryptoAlgorithm& algorithm, 55 const blink::WebCryptoAlgorithm& algorithm,
43 bool extractable, 56 bool extractable,
44 blink::WebCryptoKeyUsageMask usage_mask, 57 blink::WebCryptoKeyUsageMask usage_mask,
45 blink::WebCryptoKey* key) const OVERRIDE; 58 blink::WebCryptoKey* key) const OVERRIDE;
46 59
(...skipping 12 matching lines...) Expand all
59 private: 72 private:
60 blink::WebCryptoKeyUsageMask all_public_key_usages_; 73 blink::WebCryptoKeyUsageMask all_public_key_usages_;
61 blink::WebCryptoKeyUsageMask all_private_key_usages_; 74 blink::WebCryptoKeyUsageMask all_private_key_usages_;
62 }; 75 };
63 76
64 } // namespace webcrypto 77 } // namespace webcrypto
65 78
66 } // namespace content 79 } // namespace content
67 80
68 #endif // CONTENT_CHILD_WEBCRYPTO_OPENSSL_RSA_KEY_OPENSSL_H_ 81 #endif // CONTENT_CHILD_WEBCRYPTO_OPENSSL_RSA_KEY_OPENSSL_H_
OLDNEW
« no previous file with comments | « no previous file | content/child/webcrypto/openssl/rsa_key_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698