ssl_socket.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright (c) 2012 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. #ifndef NET_SOCKET_SSL_SOCKET_H_
  5. #define NET_SOCKET_SSL_SOCKET_H_
  6. #include "base/strings/string_piece.h"
  7. #include "net/base/net_export.h"
  8. #include "net/socket/stream_socket.h"
  9. namespace net {
  10. // SSLSocket interface defines method that are common between client
  11. // and server SSL sockets.
  12. class NET_EXPORT SSLSocket : public StreamSocket {
  13. public:
  14. ~SSLSocket() override = default;
  15. // Exports data derived from the SSL master-secret (see RFC 5705).
  16. // If |has_context| is false, uses the no-context construction from the
  17. // RFC and |context| is ignored. The call will fail with an error if
  18. // the socket is not connected or the SSL implementation does not
  19. // support the operation.
  20. virtual int ExportKeyingMaterial(const base::StringPiece& label,
  21. bool has_context,
  22. const base::StringPiece& context,
  23. unsigned char* out,
  24. unsigned int outlen) = 0;
  25. };
  26. } // namespace net
  27. #endif // NET_SOCKET_SSL_SOCKET_H_