Updating trunk VERSION from 1014.0 to 1015.0
[chromium-blink-merge.git] / net / base / x509_util_openssl_unittest.cc
blob5d96dfadb08c54b42518b36cdf18aaa67e111a64
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
3 // found in the LICENSE file.
5 #include "base/memory/scoped_ptr.h"
6 #include "crypto/rsa_private_key.h"
7 #include "net/base/x509_util.h"
8 #include "net/base/x509_util_openssl.h"
9 #include "testing/gtest/include/gtest/gtest.h"
11 namespace net {
13 // For OpenSSL, x509_util::CreateOriginBoundCert() is not yet implemented
14 // and should return false. This unit test ensures that a stub implementation
15 // is present.
16 TEST(X509UtilOpenSSLTest, CreateOriginBoundCertNotImplemented) {
17 std::string origin = "http://weborigin.com:443";
18 base::Time now = base::Time::Now();
19 scoped_ptr<crypto::RSAPrivateKey> private_key(
20 crypto::RSAPrivateKey::Create(1024));
21 std::string der_cert;
22 EXPECT_FALSE(x509_util::CreateOriginBoundCertRSA(
23 private_key.get(),
24 origin, 1,
25 now,
26 now + base::TimeDelta::FromDays(1),
27 &der_cert));
28 EXPECT_TRUE(der_cert.empty());
32 } // namespace net