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

Side by Side Diff: crypto/signature_creator_unittest.cc

Issue 9348001: Use a forward declaration of RSAPrivateKey in crypto/signature_creator.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « crypto/signature_creator_openssl.cc ('k') | crypto/signature_creator_win.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <vector> 5 #include <vector>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "crypto/rsa_private_key.h"
8 #include "crypto/signature_creator.h" 9 #include "crypto/signature_creator.h"
9 #include "crypto/signature_verifier.h" 10 #include "crypto/signature_verifier.h"
10 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
11 12
12 TEST(SignatureCreatorTest, BasicTest) { 13 TEST(SignatureCreatorTest, BasicTest) {
13 // Do a verify round trip. 14 // Do a verify round trip.
14 scoped_ptr<crypto::RSAPrivateKey> key_original( 15 scoped_ptr<crypto::RSAPrivateKey> key_original(
15 crypto::RSAPrivateKey::Create(1024)); 16 crypto::RSAPrivateKey::Create(1024));
16 ASSERT_TRUE(key_original.get()); 17 ASSERT_TRUE(key_original.get());
17 18
(...skipping 26 matching lines...) Expand all
44 crypto::SignatureVerifier verifier; 45 crypto::SignatureVerifier verifier;
45 ASSERT_TRUE(verifier.VerifyInit( 46 ASSERT_TRUE(verifier.VerifyInit(
46 kSHA1WithRSAAlgorithmID, sizeof(kSHA1WithRSAAlgorithmID), 47 kSHA1WithRSAAlgorithmID, sizeof(kSHA1WithRSAAlgorithmID),
47 &signature.front(), signature.size(), 48 &signature.front(), signature.size(),
48 &public_key_info.front(), public_key_info.size())); 49 &public_key_info.front(), public_key_info.size()));
49 50
50 verifier.VerifyUpdate(reinterpret_cast<const uint8*>(data.c_str()), 51 verifier.VerifyUpdate(reinterpret_cast<const uint8*>(data.c_str()),
51 data.size()); 52 data.size());
52 ASSERT_TRUE(verifier.VerifyFinal()); 53 ASSERT_TRUE(verifier.VerifyFinal());
53 } 54 }
OLDNEW
« no previous file with comments | « crypto/signature_creator_openssl.cc ('k') | crypto/signature_creator_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698