chromium/net/ssl/ssl_private_key.h

// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef NET_SSL_SSL_PRIVATE_KEY_H_
#define NET_SSL_SSL_PRIVATE_KEY_H_

#include <stdint.h>

#include <vector>

#include "base/containers/span.h"
#include "base/functional/callback_forward.h"
#include "base/memory/ref_counted.h"
#include "net/base/net_errors.h"
#include "net/base/net_export.h"

namespace net {

// An interface for a private key for use with SSL client authentication. A
// private key may be used with multiple signature algorithms, so methods use
// `SSL_SIGN_*` constants from BoringSSL, which correspond to TLS 1.3
// SignatureScheme values.
//
// Note that although ECDSA constants are named like
// `SSL_SIGN_ECDSA_SECP256R1_SHA256`, they may be used with any curve for
// purposes of this API. This discrepancy is due to differences between TLS 1.2
// and TLS 1.3.
//
// Implementations of this class do not need to handle the
// `SSL_SIGN_RSA_PKCS1_SHA256_LEGACY` codepoint, which re-enables
// RSASSA-PKCS1-v1_5 for TLS 1.3. SSLClientSocket will automatically convert to
// `SSL_SIGN_RSA_PKCS1_SHA256` as needed.
class NET_EXPORT SSLPrivateKey
    : public base::RefCountedThreadSafe<SSLPrivateKey> {};

}  // namespace net

#endif  // NET_SSL_SSL_PRIVATE_KEY_H_