Index: content/child/webcrypto/jwk.h |
diff --git a/content/child/webcrypto/jwk.h b/content/child/webcrypto/jwk.h |
index c9191888256d957f56c00da4bebe970307cca9c3..47aa8c064d5e7450b13ba9bf12893583270d68eb 100644 |
--- a/content/child/webcrypto/jwk.h |
+++ b/content/child/webcrypto/jwk.h |
@@ -8,6 +8,7 @@ |
#include <vector> |
#include "base/basictypes.h" |
+#include "base/values.h" |
#include "third_party/WebKit/public/platform/WebArrayBuffer.h" |
#include "third_party/WebKit/public/platform/WebCrypto.h" |
#include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" |
@@ -19,13 +20,69 @@ namespace webcrypto { |
class CryptoData; |
class Status; |
-Status ImportKeyJwk(const CryptoData& key_data, |
- const blink::WebCryptoAlgorithm& algorithm, |
- bool extractable, |
- blink::WebCryptoKeyUsageMask usage_mask, |
- blink::WebCryptoKey* key); |
+void WriteSecretKeyJwk(const CryptoData& raw_key_data, |
Ryan Sleevi
2014/07/17 22:42:55
Documentation for all these.
eroman
2014/07/17 23:33:24
Done.
|
+ const std::string& algorithm, |
+ bool extractable, |
+ blink::WebCryptoKeyUsageMask usage_mask, |
+ std::vector<uint8>* jwk_key_data); |
-Status ExportKeyJwk(const blink::WebCryptoKey& key, std::vector<uint8>* buffer); |
+Status ReadSecretKeyJwk(const CryptoData& key_data, |
+ const std::string& expected_algorithm, |
+ bool expected_extractable, |
+ blink::WebCryptoKeyUsageMask expected_usage_mask, |
+ std::vector<uint8>* raw_key_data); |
+ |
+std::string MakeJwkAesAlgorithmName(const std::string& suffix, |
+ unsigned int keylen_bytes); |
+ |
+Status ReadAesSecretKeyJwk(const CryptoData& key_data, |
+ const std::string& algorithm_name_suffix, |
+ bool expected_extractable, |
+ blink::WebCryptoKeyUsageMask expected_usage_mask, |
+ std::vector<uint8>* raw_key_data); |
+ |
+void WriteRsaPublicKeyJwk(const CryptoData& n, |
+ const CryptoData& e, |
+ const std::string& algorithm, |
+ bool extractable, |
+ blink::WebCryptoKeyUsageMask usage_mask, |
+ std::vector<uint8>* jwk_key_data); |
+ |
+void WriteRsaPrivateKeyJwk(const CryptoData& n, |
+ const CryptoData& e, |
+ const CryptoData& d, |
+ const CryptoData& p, |
+ const CryptoData& q, |
+ const CryptoData& dp, |
+ const CryptoData& dq, |
+ const CryptoData& qi, |
+ const std::string& algorithm, |
+ bool extractable, |
+ blink::WebCryptoKeyUsageMask usage_mask, |
+ std::vector<uint8>* jwk_key_data); |
+ |
+struct JwkRsaInfo { |
Ryan Sleevi
2014/07/17 22:42:55
Document, including noting, for example, that we d
eroman
2014/07/17 23:33:23
Done.
|
+ JwkRsaInfo(); |
+ ~JwkRsaInfo(); |
+ |
+ bool is_private_key; |
+ std::string n; |
+ std::string e; |
+ std::string d; |
+ std::string p; |
+ std::string q; |
+ std::string dp; |
+ std::string dq; |
+ std::string qi; |
+}; |
+ |
+Status ReadRsaKeyJwk(const CryptoData& key_data, |
+ const std::string& expected_algorithm, |
+ bool expected_extractable, |
+ blink::WebCryptoKeyUsageMask expected_usage_mask, |
+ JwkRsaInfo* result); |
+ |
+const char* GetJwkHmacAlgorithmName(blink::WebCryptoAlgorithmId hash); |
} // namespace webcrypto |