Implemented by SSL adapter to handle a connection. More...
#include <Connection.h>
Public Member Functions | |
Connection (Context &context, tcp_pcb *tcp) | |
virtual | ~Connection () |
virtual bool | isHandshakeDone () const =0 |
Checks if the handshake has finished. More... | |
virtual int | read (InputBuffer &input, uint8_t *&output)=0 |
Reads encrypted information and decrypts it. More... | |
virtual int | write (const uint8_t *data, size_t length)=0 |
Converts and sends plaintext data. More... | |
virtual CipherSuite | getCipherSuite () const =0 |
Gets the cipher suite that was used. More... | |
virtual SessionId | getSessionId () const =0 |
Gets the current session id object. Should be called after handshake. More... | |
virtual const Certificate * | getCertificate () const =0 |
Gets the certificate object. That object MUST be owned by the Connection implementation and should not be freed outside of it. More... | |
virtual void | freeCertificate ()=0 |
size_t | printTo (Print &p) const override |
For debugging. More... | |
int | writeTcpData (uint8_t *data, size_t length) |
virtual String | getErrorString (int error) const =0 |
Get string for error code. More... | |
virtual Alert | getAlert (int error) const =0 |
Get alert code from error. More... | |
![]() | |
virtual | ~Printable () |
Public Attributes | |
Context & | context |
Protected Attributes | |
tcp_pcb * | tcp |
Detailed Description
Implemented by SSL adapter to handle a connection.
Returned int
error codes are 0 for success, or < 0 for error.
The error codes themselves are implementation-specific. Use getErrorString()
to obtain the message. SSL Alerts are also reported via error codes and can be obtained using a call to getAlert()
.
Constructor & Destructor Documentation
◆ Connection()
|
inline |
◆ ~Connection()
|
inlinevirtual |
Member Function Documentation
◆ freeCertificate()
|
pure virtual |
◆ getAlert()
Get alert code from error.
- Parameters
-
error
- Return values
-
Alert Alert::INVALID if not an alert
◆ getCertificate()
|
pure virtual |
Gets the certificate object. That object MUST be owned by the Connection implementation and should not be freed outside of it.
- Return values
-
Certificate* Returns NULL if there is no certificate available
◆ getCipherSuite()
|
pure virtual |
Gets the cipher suite that was used.
- Return values
-
CipherSuite IDs as defined by SSL/TLS standard
◆ getErrorString()
Get string for error code.
◆ getSessionId()
|
pure virtual |
Gets the current session id object. Should be called after handshake.
- Return values
-
SessionId
◆ isHandshakeDone()
|
pure virtual |
Checks if the handshake has finished.
- Return values
-
bool true on success
◆ printTo()
For debugging.
Implements Printable.
◆ read()
|
pure virtual |
Reads encrypted information and decrypts it.
- Parameters
-
input Source encrypted data output Pointer to decrypted plaintext buffer
- Return values
-
0 : handshake is still in progress > 0 : there is decrypted data < 0 : error
◆ write()
Converts and sends plaintext data.
- Parameters
-
data length
- Return values
-
int length of the data that was actually written < 0 on error
◆ writeTcpData()
Member Data Documentation
◆ context
Context& Ssl::Connection::context |
◆ tcp
|
protected |
The documentation for this class was generated from the following file: