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

Side by Side 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, 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/child/webcrypto/jwk.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 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 <stdint.h> 8 #include <stdint.h>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/strings/string_piece.h"
11 #include "base/values.h" 12 #include "base/values.h"
13 #include "content/common/content_export.h"
12 #include "third_party/WebKit/public/platform/WebArrayBuffer.h" 14 #include "third_party/WebKit/public/platform/WebArrayBuffer.h"
13 #include "third_party/WebKit/public/platform/WebCrypto.h" 15 #include "third_party/WebKit/public/platform/WebCrypto.h"
14 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" 16 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h"
15 17
16 namespace content { 18 namespace content {
17 19
18 namespace webcrypto { 20 namespace webcrypto {
19 21
20 class CryptoData; 22 class CryptoData;
21 class Status; 23 class Status;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // present. 115 // present.
114 // * expected_usage_mask must be a subset of the JWK's "key_ops" if present. 116 // * expected_usage_mask must be a subset of the JWK's "key_ops" if present.
115 Status ReadRsaKeyJwk(const CryptoData& key_data, 117 Status ReadRsaKeyJwk(const CryptoData& key_data,
116 const std::string& expected_algorithm, 118 const std::string& expected_algorithm,
117 bool expected_extractable, 119 bool expected_extractable,
118 blink::WebCryptoKeyUsageMask expected_usage_mask, 120 blink::WebCryptoKeyUsageMask expected_usage_mask,
119 JwkRsaInfo* result); 121 JwkRsaInfo* result);
120 122
121 const char* GetJwkHmacAlgorithmName(blink::WebCryptoAlgorithmId hash); 123 const char* GetJwkHmacAlgorithmName(blink::WebCryptoAlgorithmId hash);
122 124
125 // This function decodes unpadded 'base64url' encoded data, as described in
126 // RFC4648 (http://www.ietf.org/rfc/rfc4648.txt) Section 5.
127 CONTENT_EXPORT bool Base64DecodeUrlSafe(const std::string& input,
128 std::string* output);
129
130 // Returns an unpadded 'base64url' encoding of the input data, the opposite of
131 // Base64DecodeUrlSafe() above.
132 CONTENT_EXPORT std::string Base64EncodeUrlSafe(const base::StringPiece& input);
133 CONTENT_EXPORT std::string Base64EncodeUrlSafe(
134 const std::vector<uint8_t>& input);
135
123 } // namespace webcrypto 136 } // namespace webcrypto
124 137
125 } // namespace content 138 } // namespace content
126 139
127 #endif // CONTENT_CHILD_WEBCRYPTO_JWK_H_ 140 #endif // CONTENT_CHILD_WEBCRYPTO_JWK_H_
OLDNEW
« 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