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

Side by Side Diff: components/webcrypto/algorithms/rsa_oaep_unittest.cc

Issue 1548203002: Convert Pass()→std::move() in //components/[n-z]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bad headers Created 4 years, 11 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 | « components/webcrypto/algorithms/rsa.cc ('k') | components/webcrypto/blink_key_handle.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 #include <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/base64url.h" 8 #include "base/base64url.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 return base64url_encoded; 42 return base64url_encoded;
43 } 43 }
44 44
45 scoped_ptr<base::DictionaryValue> CreatePublicKeyJwkDict() { 45 scoped_ptr<base::DictionaryValue> CreatePublicKeyJwkDict() {
46 scoped_ptr<base::DictionaryValue> jwk(new base::DictionaryValue()); 46 scoped_ptr<base::DictionaryValue> jwk(new base::DictionaryValue());
47 jwk->SetString("kty", "RSA"); 47 jwk->SetString("kty", "RSA");
48 jwk->SetString("n", 48 jwk->SetString("n",
49 Base64EncodeUrlSafe(HexStringToBytes(kPublicKeyModulusHex))); 49 Base64EncodeUrlSafe(HexStringToBytes(kPublicKeyModulusHex)));
50 jwk->SetString("e", 50 jwk->SetString("e",
51 Base64EncodeUrlSafe(HexStringToBytes(kPublicKeyExponentHex))); 51 Base64EncodeUrlSafe(HexStringToBytes(kPublicKeyExponentHex)));
52 return jwk.Pass(); 52 return jwk;
53 } 53 }
54 54
55 class WebCryptoRsaOaepTest : public WebCryptoTestBase {}; 55 class WebCryptoRsaOaepTest : public WebCryptoTestBase {};
56 56
57 // Import a PKCS#8 private key that uses RSAPrivateKey with the 57 // Import a PKCS#8 private key that uses RSAPrivateKey with the
58 // id-rsaEncryption OID. 58 // id-rsaEncryption OID.
59 TEST_F(WebCryptoRsaOaepTest, ImportPkcs8WithRsaEncryption) { 59 TEST_F(WebCryptoRsaOaepTest, ImportPkcs8WithRsaEncryption) {
60 blink::WebCryptoKey private_key; 60 blink::WebCryptoKey private_key;
61 ASSERT_EQ(Status::Success(), 61 ASSERT_EQ(Status::Success(),
62 ImportKey(blink::WebCryptoKeyFormatPkcs8, 62 ImportKey(blink::WebCryptoKeyFormatPkcs8,
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 EXPECT_TRUE(public_key2.extractable()); 510 EXPECT_TRUE(public_key2.extractable());
511 EXPECT_EQ(import_algorithm.id(), public_key2.algorithm().id()); 511 EXPECT_EQ(import_algorithm.id(), public_key2.algorithm().id());
512 512
513 // TODO(eroman): Export the SPKI and verify matches. 513 // TODO(eroman): Export the SPKI and verify matches.
514 } 514 }
515 } 515 }
516 516
517 } // namespace 517 } // namespace
518 518
519 } // namespace webcrypto 519 } // namespace webcrypto
OLDNEW
« no previous file with comments | « components/webcrypto/algorithms/rsa.cc ('k') | components/webcrypto/blink_key_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698