| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_CERT_UTIL_H_ |
| 6 #define NET_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_CERT_UTIL_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include "base/strings/string_piece.h" |
| 11 |
| 12 namespace net { |
| 13 class SPKIHash; |
| 14 } // namespace net |
| 15 |
| 16 // Extracts the SubjectPublicKeyInfo from the PEM encoded certificate and copies |
| 17 // the SHA256 digest to |out_hash|. Returns true on success and false on |
| 18 // failure. |
| 19 bool CalculateSPKIHashFromCertificate(base::StringPiece pem_certificate, |
| 20 net::SPKIHash* out_hash); |
| 21 |
| 22 // Calculates the SHA256 of the SubjectPublicKeyInfo in the PEM encoded |
| 23 // |pem_key| and copies the digest to |out_hash|. Returns true on success and |
| 24 // false on failure. |
| 25 bool CalculateSPKIHashFromKey(base::StringPiece pem_key, |
| 26 net::SPKIHash* out_hash); |
| 27 |
| 28 // Initializes BoringSSL. |
| 29 void InitializeCryptoLibrary(); |
| 30 |
| 31 #endif // NET_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_CERT_UTIL_H_ |
| OLD | NEW |