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

Side by Side Diff: components/webcrypto/algorithms/ec.h

Issue 2162303002: [webcrypto] Add support for import/export of "raw" formatted EC keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@usage_order
Patch Set: address feedback Created 4 years, 4 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 | « components/webcrypto/BUILD.gn ('k') | components/webcrypto/algorithms/ec.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 COMPONENTS_WEBCRYPTO_ALGORITHMS_EC_H_ 5 #ifndef COMPONENTS_WEBCRYPTO_ALGORITHMS_EC_H_
6 #define COMPONENTS_WEBCRYPTO_ALGORITHMS_EC_H_ 6 #define COMPONENTS_WEBCRYPTO_ALGORITHMS_EC_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "components/webcrypto/algorithm_implementation.h" 10 #include "components/webcrypto/algorithm_implementation.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 std::vector<uint8_t>* buffer) const override; 44 std::vector<uint8_t>* buffer) const override;
45 45
46 Status DeserializeKeyForClone(const blink::WebCryptoKeyAlgorithm& algorithm, 46 Status DeserializeKeyForClone(const blink::WebCryptoKeyAlgorithm& algorithm,
47 blink::WebCryptoKeyType type, 47 blink::WebCryptoKeyType type,
48 bool extractable, 48 bool extractable,
49 blink::WebCryptoKeyUsageMask usages, 49 blink::WebCryptoKeyUsageMask usages,
50 const CryptoData& key_data, 50 const CryptoData& key_data,
51 blink::WebCryptoKey* key) const override; 51 blink::WebCryptoKey* key) const override;
52 52
53 private: 53 private:
54 Status ImportKeyRaw(const CryptoData& key_data,
55 const blink::WebCryptoAlgorithm& algorithm,
56 bool extractable,
57 blink::WebCryptoKeyUsageMask usages,
58 blink::WebCryptoKey* key) const;
59
54 Status ImportKeyPkcs8(const CryptoData& key_data, 60 Status ImportKeyPkcs8(const CryptoData& key_data,
55 const blink::WebCryptoAlgorithm& algorithm, 61 const blink::WebCryptoAlgorithm& algorithm,
56 bool extractable, 62 bool extractable,
57 blink::WebCryptoKeyUsageMask usages, 63 blink::WebCryptoKeyUsageMask usages,
58 blink::WebCryptoKey* key) const; 64 blink::WebCryptoKey* key) const;
59 65
60 Status ImportKeySpki(const CryptoData& key_data, 66 Status ImportKeySpki(const CryptoData& key_data,
61 const blink::WebCryptoAlgorithm& algorithm, 67 const blink::WebCryptoAlgorithm& algorithm,
62 bool extractable, 68 bool extractable,
63 blink::WebCryptoKeyUsageMask usages, 69 blink::WebCryptoKeyUsageMask usages,
64 blink::WebCryptoKey* key) const; 70 blink::WebCryptoKey* key) const;
65 71
66 Status ImportKeyJwk(const CryptoData& key_data, 72 Status ImportKeyJwk(const CryptoData& key_data,
67 const blink::WebCryptoAlgorithm& algorithm, 73 const blink::WebCryptoAlgorithm& algorithm,
68 bool extractable, 74 bool extractable,
69 blink::WebCryptoKeyUsageMask usages, 75 blink::WebCryptoKeyUsageMask usages,
70 blink::WebCryptoKey* key) const; 76 blink::WebCryptoKey* key) const;
71 77
78 Status ExportKeyRaw(const blink::WebCryptoKey& key,
79 std::vector<uint8_t>* buffer) const;
80
72 Status ExportKeyPkcs8(const blink::WebCryptoKey& key, 81 Status ExportKeyPkcs8(const blink::WebCryptoKey& key,
73 std::vector<uint8_t>* buffer) const; 82 std::vector<uint8_t>* buffer) const;
74 83
75 Status ExportKeySpki(const blink::WebCryptoKey& key, 84 Status ExportKeySpki(const blink::WebCryptoKey& key,
76 std::vector<uint8_t>* buffer) const; 85 std::vector<uint8_t>* buffer) const;
77 86
78 Status ExportKeyJwk(const blink::WebCryptoKey& key, 87 Status ExportKeyJwk(const blink::WebCryptoKey& key,
79 std::vector<uint8_t>* buffer) const; 88 std::vector<uint8_t>* buffer) const;
80 89
81 const blink::WebCryptoKeyUsageMask all_public_key_usages_; 90 const blink::WebCryptoKeyUsageMask all_public_key_usages_;
82 const blink::WebCryptoKeyUsageMask all_private_key_usages_; 91 const blink::WebCryptoKeyUsageMask all_private_key_usages_;
83 }; 92 };
84 93
85 } // namespace webcrypto 94 } // namespace webcrypto
86 95
87 #endif // COMPONENTS_WEBCRYPTO_ALGORITHMS_EC_H_ 96 #endif // COMPONENTS_WEBCRYPTO_ALGORITHMS_EC_H_
OLDNEW
« no previous file with comments | « components/webcrypto/BUILD.gn ('k') | components/webcrypto/algorithms/ec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698