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

Unified Diff: components/webcrypto/jwk.cc

Issue 1355873002: [refactor] More post-NSS WebCrypto cleanups (utility functions). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address David's comments Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/webcrypto/jwk.h ('k') | components/webcrypto/webcrypto.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/webcrypto/jwk.cc
diff --git a/components/webcrypto/jwk.cc b/components/webcrypto/jwk.cc
index 701b82f1c5797e1d37a426c6f5503fba0f71683f..1a3245aceeae52c21e9c426f1b9de773960c7e0e 100644
--- a/components/webcrypto/jwk.cc
+++ b/components/webcrypto/jwk.cc
@@ -368,35 +368,6 @@ void JwkWriter::ToJson(std::vector<uint8_t>* utf8_bytes) const {
utf8_bytes->assign(json.begin(), json.end());
}
-Status ReadSecretKeyNoExpectedAlg(const CryptoData& key_data,
- bool expected_extractable,
- blink::WebCryptoKeyUsageMask expected_usages,
- std::vector<uint8_t>* raw_key_data,
- JwkReader* jwk) {
- Status status = jwk->Init(key_data, expected_extractable, expected_usages,
- "oct", std::string());
- if (status.IsError())
- return status;
-
- std::string jwk_k_value;
- status = jwk->GetBytes("k", &jwk_k_value);
- if (status.IsError())
- return status;
- raw_key_data->assign(jwk_k_value.begin(), jwk_k_value.end());
-
- return Status::Success();
-}
-
-void WriteSecretKeyJwk(const CryptoData& raw_key_data,
- const std::string& algorithm,
- bool extractable,
- blink::WebCryptoKeyUsageMask usages,
- std::vector<uint8_t>* jwk_key_data) {
- JwkWriter writer(algorithm, extractable, usages, "oct");
- writer.SetBytes("k", raw_key_data);
- writer.ToJson(jwk_key_data);
-}
-
bool Base64DecodeUrlSafe(const std::string& input, std::string* output) {
// The JSON web signature spec specifically says that padding is omitted.
if (input.find_first_of("+/=") != std::string::npos)
« no previous file with comments | « components/webcrypto/jwk.h ('k') | components/webcrypto/webcrypto.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698