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

Unified Diff: net/tools/domain_security_preload_generator/cert_util.h

Issue 2551153003: Add static domain security state generator tool. (Closed)
Patch Set: fix base64 issue and accidental replace. Created 4 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
Index: net/tools/domain_security_preload_generator/cert_util.h
diff --git a/net/tools/domain_security_preload_generator/cert_util.h b/net/tools/domain_security_preload_generator/cert_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..ca449028f079a2d5fdd6ee4923c40225084d3165
--- /dev/null
+++ b/net/tools/domain_security_preload_generator/cert_util.h
@@ -0,0 +1,31 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_CERT_UTIL_H_
+#define NET_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_CERT_UTIL_H_
+
+#include <stdint.h>
+
+#include "base/strings/string_piece.h"
+
+namespace net {
+class SPKIHash;
+} // namespace net
+
+// Extracts the SubjectPublicKeyInfo from the PEM encoded certificate and copies
+// the SHA256 digest to |out_hash|. Returns true on success and false on
+// failure.
+bool CalculateSPKIHashFromCertificate(base::StringPiece pem_certificate,
+ net::SPKIHash* out_hash);
+
+// Calculates the SHA256 of the SubjectPublicKeyInfo in the PEM encoded
+// |pem_key| and copies the digest to |out_hash|. Returns true on success and
agl 2016/12/06 18:51:35 I think this should be clearer that the contents o
martijnc 2016/12/07 22:37:53 Clarified.
+// false on failure.
+bool CalculateSPKIHashFromKey(base::StringPiece pem_key,
+ net::SPKIHash* out_hash);
+
+// Initializes BoringSSL.
+void InitializeCryptoLibrary();
agl 2016/12/06 18:51:35 Use src/crypto/openssl_util.h:EnsureOpenSSLInit ra
martijnc 2016/12/07 22:37:53 Removed and updated domain_security_preload_genera
+
+#endif // NET_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_CERT_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698