Chromium Code Reviews| 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; |