OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 return new FakeSSLCertificate(*this); | 38 return new FakeSSLCertificate(*this); |
39 } | 39 } |
40 virtual std::string ToPEMString() const { | 40 virtual std::string ToPEMString() const { |
41 return data_; | 41 return data_; |
42 } | 42 } |
43 virtual void ToDER(Buffer* der_buffer) const { | 43 virtual void ToDER(Buffer* der_buffer) const { |
44 std::string der_string; | 44 std::string der_string; |
45 VERIFY(SSLIdentity::PemToDer(kPemTypeCertificate, data_, &der_string)); | 45 VERIFY(SSLIdentity::PemToDer(kPemTypeCertificate, data_, &der_string)); |
46 der_buffer->SetData(der_string.c_str(), der_string.size()); | 46 der_buffer->SetData(der_string.c_str(), der_string.size()); |
47 } | 47 } |
| 48 int64_t CertificateExpirationTime() const override { return -1; } |
48 void set_digest_algorithm(const std::string& algorithm) { | 49 void set_digest_algorithm(const std::string& algorithm) { |
49 digest_algorithm_ = algorithm; | 50 digest_algorithm_ = algorithm; |
50 } | 51 } |
51 virtual bool GetSignatureDigestAlgorithm(std::string* algorithm) const { | 52 virtual bool GetSignatureDigestAlgorithm(std::string* algorithm) const { |
52 *algorithm = digest_algorithm_; | 53 *algorithm = digest_algorithm_; |
53 return true; | 54 return true; |
54 } | 55 } |
55 virtual bool ComputeDigest(const std::string& algorithm, | 56 virtual bool ComputeDigest(const std::string& algorithm, |
56 unsigned char* digest, | 57 unsigned char* digest, |
57 size_t size, | 58 size_t size, |
(...skipping 30 matching lines...) Expand all Loading... |
88 return new FakeSSLIdentity(*this); | 89 return new FakeSSLIdentity(*this); |
89 } | 90 } |
90 virtual const FakeSSLCertificate& certificate() const { return cert_; } | 91 virtual const FakeSSLCertificate& certificate() const { return cert_; } |
91 private: | 92 private: |
92 FakeSSLCertificate cert_; | 93 FakeSSLCertificate cert_; |
93 }; | 94 }; |
94 | 95 |
95 } // namespace rtc | 96 } // namespace rtc |
96 | 97 |
97 #endif // WEBRTC_BASE_FAKESSLIDENTITY_H_ | 98 #endif // WEBRTC_BASE_FAKESSLIDENTITY_H_ |
OLD | NEW |