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

Unified Diff: net/cert/internal/parsed_certificate.h

Issue 2803513003: Remove ParsedCertificate::unparsed_extensions(). (Closed)
Patch Set: remove unused Created 3 years, 8 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 | « net/cert/cert_verify_proc_mac.cc ('k') | net/cert/internal/parsed_certificate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/parsed_certificate.h
diff --git a/net/cert/internal/parsed_certificate.h b/net/cert/internal/parsed_certificate.h
index 06bd37890b982500c1694f14ee8f7873487acb89..9b561a03751f02b461601c9bb0b6a4393811f7e3 100644
--- a/net/cert/internal/parsed_certificate.h
+++ b/net/cert/internal/parsed_certificate.h
@@ -142,6 +142,16 @@ class NET_EXPORT ParsedCertificate
return key_usage_;
}
+ // Returns true if the certificate has a ExtendedKeyUsage extension.
+ bool has_extended_key_usage() const { return has_extended_key_usage_; }
+
+ // Returns the ExtendedKeyUsage key purpose OIDs. Caller must check
+ // has_extended_key_usage() before accessing this.
+ const std::vector<der::Input>& extended_key_usage() const {
+ DCHECK(has_extended_key_usage_);
+ return extended_key_usage_;
+ }
+
// Returns true if the certificate has a SubjectAltName extension.
bool has_subject_alt_names() const { return subject_alt_names_ != nullptr; }
@@ -184,11 +194,24 @@ class NET_EXPORT ParsedCertificate
// Returns any OCSP URIs from the AuthorityInfoAccess extension.
const std::vector<base::StringPiece>& ocsp_uris() const { return ocsp_uris_; }
- // Returns a map of unhandled extensions (excludes the ones above).
- const ExtensionsMap& unparsed_extensions() const {
- return unparsed_extensions_;
+ // Returns true if the certificate has a Policies extension.
+ bool has_policy_oids() const { return has_policy_oids_; }
+
+ // Returns the policy OIDs. Caller must check has_policy_oids() before
+ // accessing this.
+ const std::vector<der::Input>& policy_oids() const {
+ DCHECK(has_policy_oids());
+ return policy_oids_;
}
+ // Returns a map of all the extensions in the certificate.
+ const ExtensionsMap& extensions() const { return extensions_; }
+
+ // Gets the value for extension matching |extension_oid|. Returns false if the
+ // extension is not present.
+ bool GetExtension(const der::Input& extension_oid,
+ ParsedExtension* parsed_extension) const;
+
private:
friend class base::RefCountedThreadSafe<ParsedCertificate>;
ParsedCertificate();
@@ -232,6 +255,10 @@ class NET_EXPORT ParsedCertificate
bool has_key_usage_ = false;
der::BitString key_usage_;
+ // ExtendedKeyUsage extension.
+ bool has_extended_key_usage_ = false;
+ std::vector<der::Input> extended_key_usage_;
+
// Raw SubjectAltName extension.
ParsedExtension subject_alt_names_extension_;
// Parsed SubjectAltName extension.
@@ -249,8 +276,12 @@ class NET_EXPORT ParsedCertificate
std::vector<base::StringPiece> ca_issuers_uris_;
std::vector<base::StringPiece> ocsp_uris_;
- // The remaining extensions (excludes the standard ones above).
- ExtensionsMap unparsed_extensions_;
+ // Policies extension.
+ bool has_policy_oids_ = false;
+ std::vector<der::Input> policy_oids_;
+
+ // All of the extensions.
+ ExtensionsMap extensions_;
DISALLOW_COPY_AND_ASSIGN(ParsedCertificate);
};
« no previous file with comments | « net/cert/cert_verify_proc_mac.cc ('k') | net/cert/internal/parsed_certificate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698