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

Side by Side Diff: content/renderer/webcrypto/webcrypto_util.h

Issue 68303009: [webcrypto] Add RSASSA-PKCS1-v1_5 sign and verify for NSS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes for eroman and rebase Created 7 years 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ 5 #ifndef CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_
6 #define CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ 6 #define CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 17 matching lines...) Expand all
28 void ShrinkBuffer(blink::WebArrayBuffer* buffer, unsigned new_size); 28 void ShrinkBuffer(blink::WebArrayBuffer* buffer, unsigned new_size);
29 29
30 // Creates a WebArrayBuffer from a uint8 byte array 30 // Creates a WebArrayBuffer from a uint8 byte array
31 blink::WebArrayBuffer CreateArrayBuffer(const uint8* data, unsigned data_size); 31 blink::WebArrayBuffer CreateArrayBuffer(const uint8* data, unsigned data_size);
32 32
33 // This function decodes unpadded 'base64url' encoded data, as described in 33 // This function decodes unpadded 'base64url' encoded data, as described in
34 // RFC4648 (http://www.ietf.org/rfc/rfc4648.txt) Section 5. 34 // RFC4648 (http://www.ietf.org/rfc/rfc4648.txt) Section 5.
35 // In Web Crypto, this type of encoding is only used inside JWK. 35 // In Web Crypto, this type of encoding is only used inside JWK.
36 bool Base64DecodeUrlSafe(const std::string& input, std::string* output); 36 bool Base64DecodeUrlSafe(const std::string& input, std::string* output);
37 37
38 bool IsHashAlgorithm(blink::WebCryptoAlgorithmId alg_id);
39
38 // Returns the "hash" param for an algorithm if it exists, otherwise returns 40 // Returns the "hash" param for an algorithm if it exists, otherwise returns
39 // a null algorithm. 41 // a null algorithm.
40 blink::WebCryptoAlgorithm GetInnerHashAlgorithm( 42 blink::WebCryptoAlgorithm GetInnerHashAlgorithm(
41 const blink::WebCryptoAlgorithm& algorithm); 43 const blink::WebCryptoAlgorithm& algorithm);
42 44
43 // Creates a WebCryptoAlgorithm without any parameters. 45 // Creates a WebCryptoAlgorithm without any parameters.
44 CONTENT_EXPORT blink::WebCryptoAlgorithm CreateAlgorithm( 46 CONTENT_EXPORT blink::WebCryptoAlgorithm CreateAlgorithm(
45 blink::WebCryptoAlgorithmId id); 47 blink::WebCryptoAlgorithmId id);
46 48
47 // Creates an HMAC algorithm whose inner hash algorithm is determined by the 49 // Creates an HMAC algorithm whose inner hash algorithm is determined by the
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // Creates an AES-GCM algorithm whose parameters struct is compatible with key 94 // Creates an AES-GCM algorithm whose parameters struct is compatible with key
93 // generation. 95 // generation.
94 blink::WebCryptoAlgorithm CreateAesGcmKeyGenAlgorithm( 96 blink::WebCryptoAlgorithm CreateAesGcmKeyGenAlgorithm(
95 unsigned short key_length_bits); 97 unsigned short key_length_bits);
96 98
97 } // namespace webcrypto 99 } // namespace webcrypto
98 100
99 } // namespace content 101 } // namespace content
100 102
101 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_ 103 #endif // CONTENT_RENDERER_WEBCRYPTO_WEBCRYPTO_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698