OLD | NEW |
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 "net/base/origin_bound_cert_service.h" | 5 #include "net/base/origin_bound_cert_service.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 uint32 serial_number, | 319 uint32 serial_number, |
320 std::string* private_key, | 320 std::string* private_key, |
321 std::string* cert) { | 321 std::string* cert) { |
322 scoped_ptr<crypto::RSAPrivateKey> key( | 322 scoped_ptr<crypto::RSAPrivateKey> key( |
323 crypto::RSAPrivateKey::Create(kKeySizeInBits)); | 323 crypto::RSAPrivateKey::Create(kKeySizeInBits)); |
324 if (!key.get()) { | 324 if (!key.get()) { |
325 LOG(WARNING) << "Unable to create key pair for client"; | 325 LOG(WARNING) << "Unable to create key pair for client"; |
326 return ERR_KEY_GENERATION_FAILED; | 326 return ERR_KEY_GENERATION_FAILED; |
327 } | 327 } |
328 std::string der_cert; | 328 std::string der_cert; |
329 if (!x509_util::CreateOriginBoundCertRSA( | 329 if (!x509_util::CreateOriginBoundCert( |
330 key.get(), | 330 key.get(), |
331 origin, | 331 origin, |
332 serial_number, | 332 serial_number, |
333 base::TimeDelta::FromDays(kValidityPeriodInDays), | 333 base::TimeDelta::FromDays(kValidityPeriodInDays), |
334 &der_cert)) { | 334 &der_cert)) { |
335 LOG(WARNING) << "Unable to create x509 cert for client"; | 335 LOG(WARNING) << "Unable to create x509 cert for client"; |
336 return ERR_ORIGIN_BOUND_CERT_GENERATION_FAILED; | 336 return ERR_ORIGIN_BOUND_CERT_GENERATION_FAILED; |
337 } | 337 } |
338 | 338 |
339 std::vector<uint8> private_key_info; | 339 std::vector<uint8> private_key_info; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 delete job; | 380 delete job; |
381 } | 381 } |
382 | 382 |
383 int OriginBoundCertService::cert_count() { | 383 int OriginBoundCertService::cert_count() { |
384 return origin_bound_cert_store_->GetCertCount(); | 384 return origin_bound_cert_store_->GetCertCount(); |
385 } | 385 } |
386 | 386 |
387 } // namespace net | 387 } // namespace net |
388 | 388 |
389 DISABLE_RUNNABLE_METHOD_REFCOUNT(net::OriginBoundCertServiceWorker); | 389 DISABLE_RUNNABLE_METHOD_REFCOUNT(net::OriginBoundCertServiceWorker); |
OLD | NEW |