SSLClient  v1.3.0
Add TLS 1.2 functionality to any network library.
SSLSession.h
Go to the documentation of this file.
1 /* Copyright 2019 OSU OPEnS Lab
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy of this
4  * software and associated documentation files (the "Software"), to deal in the Software
5  * without restriction, including without limitation the rights to use, copy, modify,
6  * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
7  * permit persons to whom the Software is furnished to do so, subject to the following
8  * conditions:
9  *
10  * The above copyright notice and this permission notice shall be included in all
11  * copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
14  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
15  * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
16  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
17  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
18  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19  */
20 
28 #include "bearssl.h"
29 #include "Arduino.h"
30 
31 #ifndef SSLSession_H_
32 #define SSLSession_H_
33 
51 class SSLSession : public br_ssl_session_parameters {
52 
53 public:
59  SSLSession(const char* hostname)
60  : m_hostname(hostname) {}
61 
70  const String& get_hostname() const { return m_hostname; }
71 
73  br_ssl_session_parameters* to_br_session() { return (br_ssl_session_parameters *)this; }
74 
75 private:
76  // aparently a hostname has a max length of 256 chars. Go figure.
77  String m_hostname;
78 };
79 
80 
81 
82 #endif /* SSLSession_H_ */
This class stores values which allow SSLClient to save and resume SSL sessions.
Definition: SSLSession.h:51
br_ssl_session_parameters * to_br_session()
Returns a pointer to the ::br_ssl_session_parameters component of this class.
Definition: SSLSession.h:73
SSLSession(const char *hostname)
SSLSession constructor.
Definition: SSLSession.h:59
const String & get_hostname() const
Get the hostname string associated with this session.
Definition: SSLSession.h:70