// Copyright (c) 2015 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 "content/renderer/media/rtc_certificate.h" #include "base/memory/ptr_util.h" #include "url/gurl.h" namespace content { RTCCertificate::RTCCertificate( const rtc::scoped_refptr& certificate) : certificate_(certificate) { DCHECK(certificate_); } RTCCertificate::~RTCCertificate() { } std::unique_ptr RTCCertificate::ShallowCopy() const { return base::WrapUnique(new RTCCertificate(certificate_)); } uint64_t RTCCertificate::Expires() const { return certificate_->Expires(); } blink::WebRTCCertificatePEM RTCCertificate::ToPEM() const { rtc::RTCCertificatePEM pem = certificate_->ToPEM(); return blink::WebRTCCertificatePEM( blink::WebString::FromUTF8(pem.private_key()), blink::WebString::FromUTF8(pem.certificate())); } bool RTCCertificate::Equals(const blink::WebRTCCertificate& other) const { return *certificate_ == *static_cast(other).certificate_; } const rtc::scoped_refptr& RTCCertificate::rtcCertificate() const { return certificate_; } } // namespace content