cc

Dependencies:   SPWF01SA

Revision:
14:4ec13009341c
Parent:
13:0368732b5b9d
Child:
15:0a075334e0e9
--- a/SpwfInterface.h	Tue Nov 22 14:38:43 2016 +0000
+++ b/SpwfInterface.h	Mon Jan 02 14:50:17 2017 +0000
@@ -42,6 +42,7 @@
 #define SPWFSA_SOCKET_COUNT 8
 #define SERVER_SOCKET_NO    9
  
+ 
 /** SpwfSAInterface class
  *  Implementation of the NetworkStack for the SPWF Device
  */
@@ -56,9 +57,17 @@
     virtual     int connect(const char *ssid,
                             const char *pass,
                             nsapi_security_t security = NSAPI_SECURITY_NONE);
- 
     virtual     int disconnect();    
-    virtual     const char *get_mac_address();    
+    virtual     const char *get_mac_address();
+    
+    // implementation of secure sockets
+    virtual     void set_secure_sockets(void);    // to be called before socket creation if TLS/SSL is required
+    virtual     void set_unsecure_sockets(void);  // to be called after socket creation to set unsecure mode (deft)
+    virtual     bool isSecure_socket(void);       
+    virtual     int set_time(time_t ctTime);      // TLS/SSL requires correct system time to check certificates 
+    virtual     int set_TLS_certificate(char * cert, unsigned int size, CertType_t type); // root cert in PEM format 
+    virtual     int set_TLS_SRV_domain(char * domain, CertType_t type);  // secure server domain
+    virtual     int clean_TLS_certificate(CertType_t type);
     void        debug(const char * string);
     
     //Implementation of NetworkStack
@@ -87,6 +96,7 @@
     bool _ids[SPWFSA_SOCKET_COUNT];
     bool isListening;
     bool isInitialized;
+    bool isSecure;
 };