blob: ca429c08238f4ee56b5578711d2493924cf4bed1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/base/cert_database.h"
#include <openssl/x509.h>
#include "base/logging.h"
#include "net/base/crypto_module.h"
#include "net/base/net_errors.h"
#include "net/base/openssl_private_key_store.h"
#include "net/base/x509_certificate.h"
namespace net {
CertDatabase::CertDatabase() {
}
int CertDatabase::CheckUserCert(X509Certificate* cert) {
if (!cert)
return ERR_CERT_INVALID;
if (cert->HasExpired())
return ERR_CERT_DATE_INVALID;
if (!OpenSSLPrivateKeyStore::GetInstance()->FetchPrivateKey(
X509_PUBKEY_get(X509_get_X509_PUBKEY(cert->os_cert_handle()))))
return ERR_NO_PRIVATE_KEY_FOR_CERT;
return OK;
}
int CertDatabase::AddUserCert(X509Certificate* cert) {
// TODO(bulach): implement me.
NOTIMPLEMENTED();
return ERR_NOT_IMPLEMENTED;
}
void CertDatabase::ListCerts(CertificateList* certs) {
// TODO(bulach): implement me.
NOTIMPLEMENTED();
}
CryptoModule* CertDatabase::GetPublicModule() const {
// TODO(bulach): implement me.
NOTIMPLEMENTED();
return NULL;
}
CryptoModule* CertDatabase::GetPrivateModule() const {
// TODO(bulach): implement me.
NOTIMPLEMENTED();
return NULL;
}
void CertDatabase::ListModules(CryptoModuleList* modules, bool need_rw) const {
// TODO(bulach): implement me.
NOTIMPLEMENTED();
modules->clear();
}
int CertDatabase::ImportFromPKCS12(CryptoModule* module,
const std::string& data,
const string16& password,
bool is_extractable) {
// TODO(bulach): implement me.
NOTIMPLEMENTED();
return ERR_NOT_IMPLEMENTED;
}
int CertDatabase::ExportToPKCS12(const CertificateList& certs,
const string16& password,
std::string* output) const {
// TODO(bulach): implement me.
NOTIMPLEMENTED();
return 0;
}
bool CertDatabase::DeleteCertAndKey(const X509Certificate* cert) {
// TODO(bulach): implement me.
NOTIMPLEMENTED();
return false;
}
CertDatabase::TrustBits CertDatabase::GetCertTrust(const X509Certificate* cert,
CertType type) const {
// TODO(bulach): implement me.
NOTIMPLEMENTED();
return 0;
}
bool CertDatabase::SetCertTrust(const X509Certificate* cert,
CertType type,
TrustBits trust_bits) {
// TODO(bulach): implement me.
NOTIMPLEMENTED();
return false;
}
} // namespace net
|