| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef WebRTCCertificate_h | 5 #ifndef WebRTCCertificate_h |
| 6 #define WebRTCCertificate_h | 6 #define WebRTCCertificate_h |
| 7 | 7 |
| 8 #include "WebVector.h" |
| 9 |
| 8 #include "public/platform/WebRTCKeyParams.h" | 10 #include "public/platform/WebRTCKeyParams.h" |
| 9 #include "public/platform/WebString.h" | 11 #include "public/platform/WebString.h" |
| 10 | 12 |
| 11 #include <memory> | 13 #include <memory> |
| 12 | 14 |
| 13 namespace blink { | 15 namespace blink { |
| 14 | 16 |
| 17 // https://www.w3.org/TR/webrtc/#dom-rtcdtlsfingerprint |
| 18 class WebRTCDtlsFingerprint { |
| 19 public: |
| 20 WebRTCDtlsFingerprint(WebString algorithm, WebString value) |
| 21 : algorithm_(algorithm), value_(value) {} |
| 22 |
| 23 WebString Algorithm() const { return algorithm_; } |
| 24 WebString Value() const { return value_; } |
| 25 |
| 26 private: |
| 27 WebString algorithm_; |
| 28 WebString value_; |
| 29 }; |
| 30 |
| 15 // Corresponds to |rtc::RTCCertificatePEM| in WebRTC. | 31 // Corresponds to |rtc::RTCCertificatePEM| in WebRTC. |
| 16 // See |WebRTCCertificate::toPEM| and |WebRTCCertificateGenerator::fromPEM|. | 32 // See |WebRTCCertificate::toPEM| and |WebRTCCertificateGenerator::fromPEM|. |
| 17 class WebRTCCertificatePEM { | 33 class WebRTCCertificatePEM { |
| 18 public: | 34 public: |
| 19 WebRTCCertificatePEM(WebString private_key, WebString certificate) | 35 WebRTCCertificatePEM(WebString private_key, WebString certificate) |
| 20 : private_key_(private_key), certificate_(certificate) {} | 36 : private_key_(private_key), certificate_(certificate) {} |
| 21 | 37 |
| 22 WebString PrivateKey() const { return private_key_; } | 38 WebString PrivateKey() const { return private_key_; } |
| 23 WebString Certificate() const { return certificate_; } | 39 WebString Certificate() const { return certificate_; } |
| 24 | 40 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 38 WebRTCCertificate() = default; | 54 WebRTCCertificate() = default; |
| 39 virtual ~WebRTCCertificate() = default; | 55 virtual ~WebRTCCertificate() = default; |
| 40 | 56 |
| 41 // Copies the WebRTCCertificate object without copying the underlying | 57 // Copies the WebRTCCertificate object without copying the underlying |
| 42 // implementation specific (WebRTC layer) certificate. When all copies are | 58 // implementation specific (WebRTC layer) certificate. When all copies are |
| 43 // destroyed the underlying data is freed. | 59 // destroyed the underlying data is freed. |
| 44 virtual std::unique_ptr<WebRTCCertificate> ShallowCopy() const = 0; | 60 virtual std::unique_ptr<WebRTCCertificate> ShallowCopy() const = 0; |
| 45 | 61 |
| 46 // Returns the expiration time in ms relative to epoch, 1970-01-01T00:00:00Z. | 62 // Returns the expiration time in ms relative to epoch, 1970-01-01T00:00:00Z. |
| 47 virtual uint64_t Expires() const = 0; | 63 virtual uint64_t Expires() const = 0; |
| 64 virtual WebVector<WebRTCDtlsFingerprint> Fingerprints() const = 0; |
| 48 // Creates a PEM strings representation of the certificate. See also | 65 // Creates a PEM strings representation of the certificate. See also |
| 49 // |WebRTCCertificateGenerator::fromPEM|. | 66 // |WebRTCCertificateGenerator::fromPEM|. |
| 50 virtual WebRTCCertificatePEM ToPEM() const = 0; | 67 virtual WebRTCCertificatePEM ToPEM() const = 0; |
| 51 // Checks if the two certificate objects represent the same certificate value, | 68 // Checks if the two certificate objects represent the same certificate value, |
| 52 // as should be the case for a clone and the original. | 69 // as should be the case for a clone and the original. |
| 53 virtual bool Equals(const WebRTCCertificate& other) const = 0; | 70 virtual bool Equals(const WebRTCCertificate& other) const = 0; |
| 54 | 71 |
| 55 private: | 72 private: |
| 56 WebRTCCertificate(const WebRTCCertificate&) = delete; | 73 WebRTCCertificate(const WebRTCCertificate&) = delete; |
| 57 WebRTCCertificate& operator=(const WebRTCCertificate&) = delete; | 74 WebRTCCertificate& operator=(const WebRTCCertificate&) = delete; |
| 58 }; | 75 }; |
| 59 | 76 |
| 60 } // namespace blink | 77 } // namespace blink |
| 61 | 78 |
| 62 #endif // WebRTCCertificate_h | 79 #endif // WebRTCCertificate_h |
| OLD | NEW |