diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn
index a07d2c92aed65593cead899938fd452c4531eef2..9e658769a3e0ed065bb62af8cf0d50de3c461242 100644
--- a/LibOneM2M/OneM2M_Functions.ttcn
+++ b/LibOneM2M/OneM2M_Functions.ttcn
@@ -3989,6 +3989,46 @@ module OneM2M_Functions {
 		
 	}//end of commonFunctions
 	
+	
+	group SecurityFunctions {
+		
+		function f_handShake() runs on CseSimu {
+			var MsgIn v_response;
+			var RequestPrimitive v_requestNotify;
+			var PrimitiveContent v_primitiveContentResponse;
+
+			//Test component configuration
+			f_cf02UpCse1();
+
+			// Preamble (initial conditions)
+			
+			//vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
+
+			//TestBody
+			v_requestNotify.to_ := f_getResourceAddress(vc_remoteCseIndex);
+			v_requestNotify.from_ := PX_CSE1_ID;
+			v_requestNotify.primitiveContent := {securityInfo := m_contentSecurityInfo(int6)};
+			v_requestNotify.primitiveContent.securityInfo.escertkeMessage := str2oct("VExTIE1lc3NhZ2U6IENsaWVudCBIZWxsbw==");
+			v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int6, str2oct("VExTIE1lc3NhZ2VzOiBTZXJ2ZXIgSGVsbG8sIENlcnRpZmljYXRlKiwgU2VydmVyS2V5RXhjaGFuZ2UqLCBDZXJ0aWZpY2F0ZVJlcXVlc3QqLCBTZXJ2ZXJIZWxsb0RvbmU="));
+			mccPort.send(m_request(v_requestNotify));
+			
+			tc_ac.start;
+			alt {
+				[] mccPort.receive(mw_response(mw_responsePrimitive(int2000,v_primitiveContentResponse)))-> value v_response {
+					tc_ac.stop;
+					setverdict(pass, __SCOPE__ & ": Handshake completed successfully");	
+				}
+				[] tc_ac.timeout {
+					setverdict(inconc, __SCOPE__& ":INFO: Timeout while awaiting the reception of a message");
+				}
+			}
+					
+			f_cf02DownCseSimuMaster();
+			
+		}// end f_handShake
+				
+	} //end of SecuityFunctions
+	
 	group externalFunctions {
 		
 		/**
diff --git a/OneM2M_Testcases_CSE_Release_2_SEC_STF531.ttcn b/OneM2M_Testcases_CSE_Release_2_SEC_STF531.ttcn
index f5272f27feee93f330110ae585a2cbd07005f718..15a2122549c451ce3440e286995f8a93ce1a21e4 100644
--- a/OneM2M_Testcases_CSE_Release_2_SEC_STF531.ttcn
+++ b/OneM2M_Testcases_CSE_Release_2_SEC_STF531.ttcn
@@ -85,29 +85,80 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 {
 				var MsgIn v_response;
 				var RequestPrimitive v_requestNotify;
 				var PrimitiveContent v_primitiveContentResponse;
+				
 				//Test component configuration
 				f_cf02UpCse1();
 
 				// Test adapter configuration
 				
-				// Preamble
+				// Preamble (initial conditions)
 				vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
-				//TODO => " and the IUT has been provisioned with private key and certificate"
-				//Test Commit
+				//Preconfiguration => "and the IUT has been provisioned with private key and certificate"
 				
 				//TestBody
 				v_requestNotify.to_ := f_getResourceAddress(vc_remoteCseIndex);
 				v_requestNotify.from_ := PX_CSE1_ID;
 				v_requestNotify.primitiveContent := {securityInfo := m_contentSecurityInfo(int6)};
-				v_requestNotify.primitiveContent.securityInfo.escertkeMessage := str2oct("VExTIE1lc3NhZ2U6IENsaWVudCBIZWxsbw==");
+				
+				//TODO Base 64 representation of message ? 
+				v_requestNotify.primitiveContent.securityInfo.escertkeMessage := str2oct("ClientHello");				
+ 				v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int6, str2oct("ServerHello, Certificate*, ServerKeyExchange*, CertificateRequest*, ServerHelloDone"));
  				
- 				v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int6, str2oct("VExTIE1lc3NhZ2VzOiBTZXJ2ZXIgSGVsbG8sIENlcnRpZmljYXRlKiwgU2VydmVyS2V5RXhjaGFuZ2UqLCBDZXJ0aWZpY2F0ZVJlcXVlc3QqLCBTZXJ2ZXJIZWxsb0RvbmU="));
  				mccPort.send(m_request(v_requestNotify));
 			 	tc_ac.start;
 				alt {
 					[] mccPort.receive(mw_response(mw_responsePrimitive(int2000,v_primitiveContentResponse)))-> value v_response {
 						tc_ac.stop;
-						setverdict(pass, __SCOPE__ & ": Message 2 received successfully");	
+						setverdict(pass, __SCOPE__ & ": ESCertKE Message 2 received successfully");	
+					}
+					[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
+						tc_ac.stop;
+						setverdict(fail, __SCOPE__ & ": Wrong SecurityInfo (securityInfoType ¦¦ escertkeMessage ) Message received");
+					}
+					[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
+						tc_ac.stop;
+						setverdict(fail, __SCOPE__ & ": Wrong response status code");
+					}				
+					[] tc_ac.timeout {
+						setverdict(inconc, __SCOPE__& ":INFO: Timeout while awaiting the reception of a message");
+					}
+				}		
+						
+				f_cse_postamble_deleteResourcesCSE();
+				f_cf02DownCseSimuMaster();
+			}
+			
+			
+
+			testcase TC_CSE_ESC_BV_002() runs on CseSimu system CseSystem {
+				var MsgIn v_response;
+				var RequestPrimitive v_requestNotify;
+				var PrimitiveContent v_primitiveContentResponse;
+				
+				//Test component configuration
+				f_cf02UpCse1();
+
+				// Test adapter configuration
+				
+				// Preamble (initial conditions)
+				vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
+				f_handShake();
+				//Preconfiguration => "and the IUT has been provisioned with private key and certificate"
+				
+				//TestBody
+				v_requestNotify.to_ := f_getResourceAddress(vc_remoteCseIndex);
+				v_requestNotify.from_ := PX_CSE1_ID;
+				v_requestNotify.primitiveContent := {securityInfo := m_contentSecurityInfo(int6)};
+				
+				//TODO Base 64 representation of message ? 
+				v_requestNotify.primitiveContent.securityInfo.escertkeMessage := str2oct("Certificate*, ClientKeyExchange, CertificateVerify*, [ChangeCipherSpec], Finished");
+				v_primitiveContentResponse.securityInfo := mw_contentSecurityInfo(int6, str2oct("[ChangeCipherSpec], Finished"));
+				mccPort.send(m_request(v_requestNotify));
+				tc_ac.start;
+				alt {
+					[] mccPort.receive(mw_response(mw_responsePrimitive(int2000,v_primitiveContentResponse)))-> value v_response {
+						tc_ac.stop;
+						setverdict(pass, __SCOPE__ & ": ESCertKE Message 4 received successfully");	
 					}
 					[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
 						tc_ac.stop;
@@ -118,7 +169,7 @@ module OneM2M_Testcases_CSE_Release_2_SEC_STF531 {
 						setverdict(fail, __SCOPE__ & ": Wrong response status code");
 					}				
 					[] tc_ac.timeout {
-						setverdict(inconc, __SCOPE__&":INFO: Timeout while awaiting the reception of a message");
+						setverdict(inconc, __SCOPE__& ":INFO: Timeout while awaiting the reception of a message");
 					}
 				}