OLD | NEW |
---|---|
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_JWK_H_ | 5 #ifndef CONTENT_CHILD_WEBCRYPTO_JWK_H_ |
6 #define CONTENT_CHILD_WEBCRYPTO_JWK_H_ | 6 #define CONTENT_CHILD_WEBCRYPTO_JWK_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/values.h" | |
11 #include "third_party/WebKit/public/platform/WebArrayBuffer.h" | 12 #include "third_party/WebKit/public/platform/WebArrayBuffer.h" |
12 #include "third_party/WebKit/public/platform/WebCrypto.h" | 13 #include "third_party/WebKit/public/platform/WebCrypto.h" |
13 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" | 14 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" |
14 | 15 |
15 namespace content { | 16 namespace content { |
16 | 17 |
17 namespace webcrypto { | 18 namespace webcrypto { |
18 | 19 |
19 class CryptoData; | 20 class CryptoData; |
20 class Status; | 21 class Status; |
21 | 22 |
22 Status ImportKeyJwk(const CryptoData& key_data, | 23 void WriteSecretKeyJwk(const CryptoData& raw_key_data, |
23 const blink::WebCryptoAlgorithm& algorithm, | 24 const std::string& algorithm, |
24 bool extractable, | 25 bool extractable, |
25 blink::WebCryptoKeyUsageMask usage_mask, | 26 blink::WebCryptoKeyUsageMask usage_mask, |
26 blink::WebCryptoKey* key); | 27 std::vector<uint8>* jwk_key_data); |
27 | 28 |
28 Status ExportKeyJwk(const blink::WebCryptoKey& key, std::vector<uint8>* buffer); | 29 Status ReadSecretKeyJwk(const CryptoData& key_data, |
30 const std::string& expected_algorithm, | |
31 bool expected_extractable, | |
32 blink::WebCryptoKeyUsageMask expected_usage_mask, | |
33 std::vector<uint8>* raw_key_data, | |
34 std::string* actual_algorithm); | |
35 | |
36 void WriteRsaPublicKeyJwk(const CryptoData& n, | |
37 const CryptoData& e, | |
38 const std::string& algorithm, | |
39 bool extractable, | |
40 blink::WebCryptoKeyUsageMask usage_mask, | |
41 std::vector<uint8>* jwk_key_data); | |
42 | |
43 void WriteRsaPrivateKeyJwk(const CryptoData& n, | |
44 const CryptoData& e, | |
45 const CryptoData& d, | |
46 const CryptoData& p, | |
47 const CryptoData& q, | |
48 const CryptoData& dp, | |
49 const CryptoData& dq, | |
50 const CryptoData& qi, | |
51 const std::string& algorithm, | |
52 bool extractable, | |
53 blink::WebCryptoKeyUsageMask usage_mask, | |
54 std::vector<uint8>* jwk_key_data); | |
55 | |
56 Status ReadRsaKeyJwk(const CryptoData& key_data, | |
57 const std::string& expected_algorithm, | |
58 bool expected_extractable, | |
59 blink::WebCryptoKeyUsageMask expected_usage_mask, | |
60 bool* is_private_key, | |
61 std::string* n, | |
62 std::string* e, | |
63 std::string* d, | |
64 std::string* p, | |
65 std::string* q, | |
66 std::string* dp, | |
67 std::string* dq, | |
68 std::string* qi); | |
Ryan Sleevi
2014/07/10 23:20:54
Feels like these properties should be rolled into
eroman
2014/07/11 00:27:36
Good idea.
| |
29 | 69 |
30 } // namespace webcrypto | 70 } // namespace webcrypto |
31 | 71 |
32 } // namespace content | 72 } // namespace content |
33 | 73 |
34 #endif // CONTENT_CHILD_WEBCRYPTO_JWK_H_ | 74 #endif // CONTENT_CHILD_WEBCRYPTO_JWK_H_ |
OLD | NEW |