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

Unified Diff: content/child/webcrypto/jwk.h

Issue 504413004: Move base64-urlsafe helpers to jwk.{cc,h} (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and add missing headers Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/child/webcrypto/jwk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/jwk.h
diff --git a/content/child/webcrypto/jwk.h b/content/child/webcrypto/jwk.h
index 2baa022e6fd4505d8c5c55428dd5911be0f7fd25..9c7a769001156a2d8f16f5e1e48a5fca35ea0c16 100644
--- a/content/child/webcrypto/jwk.h
+++ b/content/child/webcrypto/jwk.h
@@ -8,7 +8,9 @@
#include <stdint.h>
#include <vector>
+#include "base/strings/string_piece.h"
#include "base/values.h"
+#include "content/common/content_export.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"
@@ -120,6 +122,17 @@ Status ReadRsaKeyJwk(const CryptoData& key_data,
const char* GetJwkHmacAlgorithmName(blink::WebCryptoAlgorithmId hash);
+// This function decodes unpadded 'base64url' encoded data, as described in
+// RFC4648 (http://www.ietf.org/rfc/rfc4648.txt) Section 5.
+CONTENT_EXPORT bool Base64DecodeUrlSafe(const std::string& input,
+ std::string* output);
+
+// Returns an unpadded 'base64url' encoding of the input data, the opposite of
+// Base64DecodeUrlSafe() above.
+CONTENT_EXPORT std::string Base64EncodeUrlSafe(const base::StringPiece& input);
+CONTENT_EXPORT std::string Base64EncodeUrlSafe(
+ const std::vector<uint8_t>& input);
+
} // namespace webcrypto
} // namespace content
« no previous file with comments | « no previous file | content/child/webcrypto/jwk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698