| 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
|
| +// false on failure.
|
| +bool CalculateSPKIHashFromKey(base::StringPiece pem_key,
|
| + net::SPKIHash* out_hash);
|
| +
|
| +// Initializes BoringSSL.
|
| +void InitializeCryptoLibrary();
|
| +
|
| +#endif // NET_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_CERT_UTIL_H_
|
|
|