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

Unified Diff: webrtc/base/sslidentity.h

Issue 1468273004: Provide method for returning certificate expiration timestamp. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Windows fixes Created 5 years 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/opensslidentity.cc ('k') | webrtc/base/sslidentity.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/sslidentity.h
diff --git a/webrtc/base/sslidentity.h b/webrtc/base/sslidentity.h
index cf9942637e480de935bdfaad3667f18555ddccc2..b8063cee1569c0d7fea44f9a625e4f8e734cbbd3 100644
--- a/webrtc/base/sslidentity.h
+++ b/webrtc/base/sslidentity.h
@@ -19,6 +19,7 @@
#include "webrtc/base/buffer.h"
#include "webrtc/base/messagedigest.h"
+#include "webrtc/base/timeutils.h"
namespace rtc {
@@ -68,6 +69,9 @@ class SSLCertificate {
unsigned char* digest,
size_t size,
size_t* length) const = 0;
+
+ // Returns the time in seconds relative to epoch.
+ virtual int64_t CertificateExpirationTime() const = 0;
};
// SSLCertChain is a simple wrapper for a vector of SSLCertificates. It serves
@@ -168,8 +172,8 @@ KeyType IntKeyTypeFamilyToKeyType(int key_type_family);
// random string will be used.
struct SSLIdentityParams {
std::string common_name;
- int not_before; // offset from current time in seconds.
- int not_after; // offset from current time in seconds.
+ time_t not_before; // Absolute time since epoch in seconds.
+ time_t not_after; // Absolute time since epoch in seconds.
KeyParams key_params;
};
@@ -217,6 +221,11 @@ class SSLIdentity {
size_t length);
};
+// Convert from ASN1 time as restricted by RFC 5280 to seconds from 1970-01-01
+// 00.00 ("epoch"). If the ASN1 time cannot be read, return -1. The data at
+// |s| is not 0-terminated; its char count is defined by |length|.
+int64_t ASN1TimeToSec(const unsigned char* s, size_t length, bool long_format);
+
extern const char kPemTypeCertificate[];
extern const char kPemTypeRsaPrivateKey[];
extern const char kPemTypeEcPrivateKey[];
« no previous file with comments | « webrtc/base/opensslidentity.cc ('k') | webrtc/base/sslidentity.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698