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

Unified Diff: net/cert/x509_certificate.h

Issue 1720653002: Add new functions to handle UPN and email addresses (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't squash 10 other commits into the same CL Created 4 years, 10 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 | « no previous file | net/cert/x509_certificate_nss.cc » ('j') | net/cert/x509_util.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/x509_certificate.h
diff --git a/net/cert/x509_certificate.h b/net/cert/x509_certificate.h
index d70e62922580189fad99733ee6f3c89f88809c4c..07dec1e1ee4bb1e3341b282bf0fd6685afdbe42f 100644
--- a/net/cert/x509_certificate.h
+++ b/net/cert/x509_certificate.h
@@ -134,6 +134,17 @@ class NET_EXPORT X509Certificate
PICKLETYPE_CERTIFICATE_CHAIN_V3,
};
+ // Allows the caller to filter the subjectAltName list and return only
+ // a specific data type (e.g. email addresses or Microsoft User Principal
+ // Name).
+ enum SubjectAltNameType {
+ SAN_RFC822_NAME,
+ SAN_DNS_NAME,
+ SAN_URI,
Ryan Sleevi 2016/02/27 00:38:45 Concrete reasons I don't like this: Exposing RFC 8
Kevin Cernekee 2016/02/27 19:06:23 Done.
+ SAN_IP_ADDRESS,
+ SAN_UPN,
+ };
+
// Creates a X509Certificate from the ground up. Used by tests that simulate
// SSL connections.
X509Certificate(const std::string& subject, const std::string& issuer,
@@ -234,6 +245,11 @@ class NET_EXPORT X509Certificate
void GetSubjectAltName(std::vector<std::string>* dns_names,
std::vector<std::string>* ip_addrs) const;
+ // Gets a specific type of subjectAltName only. Currently implemented
+ // for NSS.
+ void GetSubjectAltName(SubjectAltNameType type,
+ std::vector<std::string>* names) const;
+
// Convenience method that returns whether this certificate has expired as of
// now.
bool HasExpired() const;
« no previous file with comments | « no previous file | net/cert/x509_certificate_nss.cc » ('j') | net/cert/x509_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698