Chromium Code Reviews| Index: webrtc/base/rtccertificate.cc |
| diff --git a/webrtc/base/rtccertificate.cc b/webrtc/base/rtccertificate.cc |
| index 7b764bd72e66faa2a63afb49894f61414ca15d08..0819446e39e8b57b9a447a3b2594b013103e0dd2 100644 |
| --- a/webrtc/base/rtccertificate.cc |
| +++ b/webrtc/base/rtccertificate.cc |
| @@ -43,4 +43,24 @@ const SSLCertificate& RTCCertificate::ssl_certificate() const { |
| return identity_->certificate(); |
| } |
| +RTCCertificatePem RTCCertificate::ToPem() const { |
| + return RTCCertificatePem(identity_->PrivateKeyToPEMString(), |
| + ssl_certificate().ToPEMString()); |
| +} |
| + |
| +scoped_refptr<RTCCertificate> RTCCertificate::FromPem( |
|
torbjorng (webrtc)
2016/04/26 13:35:51
Please use PEM xor Pem as part of method names.
hbos
2016/04/27 07:52:09
Done.
|
| + const RTCCertificatePem& pem) { |
| + scoped_ptr<SSLIdentity> identity(SSLIdentity::FromPEMStrings( |
| + pem.private_key(), pem.certificate())); |
| + return new RefCountedObject<RTCCertificate>(identity.release()); |
| +} |
| + |
| +bool RTCCertificate::operator==(const RTCCertificate& certificate) const { |
| + return *this->identity_ == *certificate.identity_; |
| +} |
| + |
| +bool RTCCertificate::operator!=(const RTCCertificate& certificate) const { |
| + return !(*this == certificate); |
| +} |
| + |
| } // namespace rtc |