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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 | 61 |
62 // Gets the name of the digest algorithm that was used to compute this | 62 // Gets the name of the digest algorithm that was used to compute this |
63 // certificate's signature. | 63 // certificate's signature. |
64 virtual bool GetSignatureDigestAlgorithm(std::string* algorithm) const = 0; | 64 virtual bool GetSignatureDigestAlgorithm(std::string* algorithm) const = 0; |
65 | 65 |
66 // Compute the digest of the certificate given algorithm | 66 // Compute the digest of the certificate given algorithm |
67 virtual bool ComputeDigest(const std::string& algorithm, | 67 virtual bool ComputeDigest(const std::string& algorithm, |
68 unsigned char* digest, | 68 unsigned char* digest, |
69 size_t size, | 69 size_t size, |
70 size_t* length) const = 0; | 70 size_t* length) const = 0; |
71 | |
72 // Returns the time in milliseconds relative to epoch. | |
73 virtual int64_t CertificateExpirationTime() const = 0; | |
71 }; | 74 }; |
72 | 75 |
73 // SSLCertChain is a simple wrapper for a vector of SSLCertificates. It serves | 76 // SSLCertChain is a simple wrapper for a vector of SSLCertificates. It serves |
74 // primarily to ensure proper memory management (especially deletion) of the | 77 // primarily to ensure proper memory management (especially deletion) of the |
75 // SSLCertificate pointers. | 78 // SSLCertificate pointers. |
76 class SSLCertChain { | 79 class SSLCertChain { |
77 public: | 80 public: |
78 // These constructors copy the provided SSLCertificate(s), so the caller | 81 // These constructors copy the provided SSLCertificate(s), so the caller |
79 // retains ownership. | 82 // retains ownership. |
80 explicit SSLCertChain(const std::vector<SSLCertificate*>& certs); | 83 explicit SSLCertChain(const std::vector<SSLCertificate*>& certs); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 // TODO(hbos): Remove once rtc::KeyType (to be modified) and | 164 // TODO(hbos): Remove once rtc::KeyType (to be modified) and |
162 // blink::WebRTCKeyType (to be landed) match. By using this function in Chromium | 165 // blink::WebRTCKeyType (to be landed) match. By using this function in Chromium |
163 // appropriately we can change KeyType enum -> class without breaking Chromium. | 166 // appropriately we can change KeyType enum -> class without breaking Chromium. |
164 KeyType IntKeyTypeFamilyToKeyType(int key_type_family); | 167 KeyType IntKeyTypeFamilyToKeyType(int key_type_family); |
165 | 168 |
166 // Parameters for generating a certificate. If |common_name| is non-empty, it | 169 // Parameters for generating a certificate. If |common_name| is non-empty, it |
167 // will be used for the certificate's subject and issuer name, otherwise a | 170 // will be used for the certificate's subject and issuer name, otherwise a |
168 // random string will be used. | 171 // random string will be used. |
169 struct SSLIdentityParams { | 172 struct SSLIdentityParams { |
170 std::string common_name; | 173 std::string common_name; |
171 int not_before; // offset from current time in seconds. | 174 bool absolute_time; // How to interpret |not_before| and |not_after|. |
172 int not_after; // offset from current time in seconds. | 175 int64_t not_before; // Offset from current time or absolute time in seconds. |
176 int64_t not_after; // Offset from current time or absolute time in seconds. | |
hbos
2015/11/25 11:18:31
Is this necessary? Now any code that use these hav
torbjorng (webrtc)
2015/11/25 14:27:11
I changed the logic around this to always use time
| |
173 KeyParams key_params; | 177 KeyParams key_params; |
174 }; | 178 }; |
175 | 179 |
176 // Our identity in an SSL negotiation: a keypair and certificate (both | 180 // Our identity in an SSL negotiation: a keypair and certificate (both |
177 // with the same public key). | 181 // with the same public key). |
178 // This too is pretty much immutable once created. | 182 // This too is pretty much immutable once created. |
179 class SSLIdentity { | 183 class SSLIdentity { |
180 public: | 184 public: |
181 // Generates an identity (keypair and self-signed certificate). If | 185 // Generates an identity (keypair and self-signed certificate). If |
182 // common_name is non-empty, it will be used for the certificate's | 186 // common_name is non-empty, it will be used for the certificate's |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
217 size_t length); | 221 size_t length); |
218 }; | 222 }; |
219 | 223 |
220 extern const char kPemTypeCertificate[]; | 224 extern const char kPemTypeCertificate[]; |
221 extern const char kPemTypeRsaPrivateKey[]; | 225 extern const char kPemTypeRsaPrivateKey[]; |
222 extern const char kPemTypeEcPrivateKey[]; | 226 extern const char kPemTypeEcPrivateKey[]; |
223 | 227 |
224 } // namespace rtc | 228 } // namespace rtc |
225 | 229 |
226 #endif // WEBRTC_BASE_SSLIDENTITY_H_ | 230 #endif // WEBRTC_BASE_SSLIDENTITY_H_ |
OLD | NEW |