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

Side by Side Diff: webrtc/base/rtccertificate.h

Issue 1299223002: Adds RTCCertificate, a reference counted object indirectly owning an SSLCertificate (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: ~RTCCertificate() {} to fix compile error on trybots Created 5 years, 4 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
« no previous file with comments | « webrtc/base/base.gyp ('k') | webrtc/base/rtccertificate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 The WebRTC Project Authors. All rights reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef WEBRTC_BASE_RTCCERTIFICATE_H_
12 #define WEBRTC_BASE_RTCCERTIFICATE_H_
13
14 #include "webrtc/base/basictypes.h"
15 #include "webrtc/base/refcount.h"
16 #include "webrtc/base/scoped_ptr.h"
17 #include "webrtc/base/scoped_ref_ptr.h"
18 #include "webrtc/base/sslidentity.h"
19
20 namespace rtc {
21
22 // A thin abstraction layer between "lower level crypto stuff" like
23 // SSLCertificate and WebRTC usage. Takes ownership of some lower level objects,
24 // reference counting protects these from premature destruction.
25 class RTCCertificate : public RefCountInterface {
26 public:
27 // Takes ownership of |identity|.
28 static scoped_refptr<RTCCertificate> Create(scoped_ptr<SSLIdentity> identity);
29
30 uint64 expires_timestamp_ns() const;
31 bool HasExpired() const;
32 const SSLCertificate& ssl_certificate() const;
33
34 // TODO(hbos): If possible, remove once RTCCertificate and its
35 // ssl_certificate() is used in all relevant places. Should not pass around
36 // raw SSLIdentity* for the sake of accessing SSLIdentity::certificate().
37 // However, some places might need SSLIdentity* for its public/private key...
38 SSLIdentity* identity() const { return identity_.get(); }
39
40 protected:
41 explicit RTCCertificate(SSLIdentity* identity);
42 ~RTCCertificate() override;
43
44 private:
45 // The SSLIdentity is the owner of the SSLCertificate. To protect our
46 // ssl_certificate() we take ownership of |identity_|.
47 scoped_ptr<SSLIdentity> identity_;
48 };
49
50 } // namespace rtc
51
52 #endif // WEBRTC_BASE_RTCCERTIFICATE_H_
OLDNEW
« no previous file with comments | « webrtc/base/base.gyp ('k') | webrtc/base/rtccertificate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698