OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 SECKEYPrivateKey* privkey() const { return privkey_; } | 54 SECKEYPrivateKey* privkey() const { return privkey_; } |
55 SECKEYPublicKey * pubkey() const { return pubkey_; } | 55 SECKEYPublicKey * pubkey() const { return pubkey_; } |
56 SSLKEAType ssl_kea_type() const { return ssl_kea_type_; } | 56 SSLKEAType ssl_kea_type() const { return ssl_kea_type_; } |
57 | 57 |
58 private: | 58 private: |
59 SECKEYPrivateKey* privkey_; | 59 SECKEYPrivateKey* privkey_; |
60 SECKEYPublicKey* pubkey_; | 60 SECKEYPublicKey* pubkey_; |
61 SSLKEAType ssl_kea_type_; | 61 SSLKEAType ssl_kea_type_; |
62 | 62 |
63 DISALLOW_COPY_AND_ASSIGN(NSSKeyPair); | 63 RTC_DISALLOW_COPY_AND_ASSIGN(NSSKeyPair); |
64 }; | 64 }; |
65 | 65 |
66 | 66 |
67 class NSSCertificate : public SSLCertificate { | 67 class NSSCertificate : public SSLCertificate { |
68 public: | 68 public: |
69 static NSSCertificate* FromPEMString(const std::string& pem_string); | 69 static NSSCertificate* FromPEMString(const std::string& pem_string); |
70 // The caller retains ownership of the argument to all the constructors, | 70 // The caller retains ownership of the argument to all the constructors, |
71 // and the constructor makes a copy. | 71 // and the constructor makes a copy. |
72 explicit NSSCertificate(CERTCertificate* cert); | 72 explicit NSSCertificate(CERTCertificate* cert); |
73 explicit NSSCertificate(CERTCertList* cert_list); | 73 explicit NSSCertificate(CERTCertList* cert_list); |
(...skipping 28 matching lines...) Expand all Loading... |
102 bool Equals(const NSSCertificate* tocompare) const; | 102 bool Equals(const NSSCertificate* tocompare) const; |
103 | 103 |
104 private: | 104 private: |
105 NSSCertificate(CERTCertificate* cert, SSLCertChain* chain); | 105 NSSCertificate(CERTCertificate* cert, SSLCertChain* chain); |
106 static bool GetDigestObject(const std::string& algorithm, | 106 static bool GetDigestObject(const std::string& algorithm, |
107 const SECHashObject** hash_object); | 107 const SECHashObject** hash_object); |
108 | 108 |
109 CERTCertificate* certificate_; | 109 CERTCertificate* certificate_; |
110 scoped_ptr<SSLCertChain> chain_; | 110 scoped_ptr<SSLCertChain> chain_; |
111 | 111 |
112 DISALLOW_COPY_AND_ASSIGN(NSSCertificate); | 112 RTC_DISALLOW_COPY_AND_ASSIGN(NSSCertificate); |
113 }; | 113 }; |
114 | 114 |
115 // Represents a SSL key pair and certificate for NSS. | 115 // Represents a SSL key pair and certificate for NSS. |
116 class NSSIdentity : public SSLIdentity { | 116 class NSSIdentity : public SSLIdentity { |
117 public: | 117 public: |
118 static NSSIdentity* Generate(const std::string& common_name, | 118 static NSSIdentity* Generate(const std::string& common_name, |
119 KeyType key_type); | 119 KeyType key_type); |
120 static NSSIdentity* GenerateForTest(const SSLIdentityParams& params); | 120 static NSSIdentity* GenerateForTest(const SSLIdentityParams& params); |
121 static SSLIdentity* FromPEMStrings(const std::string& private_key, | 121 static SSLIdentity* FromPEMStrings(const std::string& private_key, |
122 const std::string& certificate); | 122 const std::string& certificate); |
123 ~NSSIdentity() override; | 123 ~NSSIdentity() override; |
124 | 124 |
125 NSSIdentity* GetReference() const override; | 125 NSSIdentity* GetReference() const override; |
126 NSSCertificate& certificate() const override; | 126 NSSCertificate& certificate() const override; |
127 | 127 |
128 NSSKeyPair* keypair() const { return keypair_.get(); } | 128 NSSKeyPair* keypair() const { return keypair_.get(); } |
129 | 129 |
130 private: | 130 private: |
131 NSSIdentity(NSSKeyPair* keypair, NSSCertificate* cert); | 131 NSSIdentity(NSSKeyPair* keypair, NSSCertificate* cert); |
132 | 132 |
133 static NSSIdentity* GenerateInternal(const SSLIdentityParams& params); | 133 static NSSIdentity* GenerateInternal(const SSLIdentityParams& params); |
134 | 134 |
135 rtc::scoped_ptr<NSSKeyPair> keypair_; | 135 rtc::scoped_ptr<NSSKeyPair> keypair_; |
136 rtc::scoped_ptr<NSSCertificate> certificate_; | 136 rtc::scoped_ptr<NSSCertificate> certificate_; |
137 | 137 |
138 DISALLOW_COPY_AND_ASSIGN(NSSIdentity); | 138 RTC_DISALLOW_COPY_AND_ASSIGN(NSSIdentity); |
139 }; | 139 }; |
140 | 140 |
141 } // namespace rtc | 141 } // namespace rtc |
142 | 142 |
143 #endif // WEBRTC_BASE_NSSIDENTITY_H_ | 143 #endif // WEBRTC_BASE_NSSIDENTITY_H_ |
OLD | NEW |