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

Unified Diff: webrtc/base/opensslidentity.h

Issue 1898383003: RTCCertificate serialization. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase with master (std::unique_ptr) Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/fakesslidentity.h ('k') | webrtc/base/opensslidentity.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/opensslidentity.h
diff --git a/webrtc/base/opensslidentity.h b/webrtc/base/opensslidentity.h
index 823f5388ae24c340f36d1796e7abc37bc4ea2947..316572c48bb458f790df03cbacfc7e04e2eb16e9 100644
--- a/webrtc/base/opensslidentity.h
+++ b/webrtc/base/opensslidentity.h
@@ -34,12 +34,20 @@ class OpenSSLKeyPair {
}
static OpenSSLKeyPair* Generate(const KeyParams& key_params);
+ // Constructs a key pair from the private key PEM string. This must not result
+ // in missing public key parameters. Returns null on error.
+ static OpenSSLKeyPair* FromPrivateKeyPEMString(
+ const std::string& pem_string);
virtual ~OpenSSLKeyPair();
virtual OpenSSLKeyPair* GetReference();
EVP_PKEY* pkey() const { return pkey_; }
+ std::string PrivateKeyToPEMString() const;
+ std::string PublicKeyToPEMString() const;
+ bool operator==(const OpenSSLKeyPair& other) const;
+ bool operator!=(const OpenSSLKeyPair& other) const;
private:
void AddReference();
@@ -69,8 +77,9 @@ class OpenSSLCertificate : public SSLCertificate {
X509* x509() const { return x509_; }
std::string ToPEMString() const override;
-
void ToDER(Buffer* der_buffer) const override;
+ bool operator==(const OpenSSLCertificate& other) const;
+ bool operator!=(const OpenSSLCertificate& other) const;
// Compute the digest of the certificate given algorithm
bool ComputeDigest(const std::string& algorithm,
@@ -116,6 +125,11 @@ class OpenSSLIdentity : public SSLIdentity {
// Configure an SSL context object to use our key and certificate.
bool ConfigureIdentity(SSL_CTX* ctx);
+ std::string PrivateKeyToPEMString() const override;
+ std::string PublicKeyToPEMString() const override;
+ bool operator==(const OpenSSLIdentity& other) const;
+ bool operator!=(const OpenSSLIdentity& other) const;
+
private:
OpenSSLIdentity(OpenSSLKeyPair* key_pair, OpenSSLCertificate* certificate);
« no previous file with comments | « webrtc/base/fakesslidentity.h ('k') | webrtc/base/opensslidentity.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698