package com.eactive.eai.adapter.socket2.protocol.envelop.handshake;//package com.eactive.eai.adapter.socket2.protocol.envelop.handshake;
//
//import org.apache.mina.common.IoSession;
//
//import com.eactive.eai.adapter.socket2.protocol.ByteMessage;
//import com.sf.xc.XCE2EClient;
//import com.sf.xc.XCE2EServer;
//
//public class EnvelopCodec {
//	public static ByteMessage e2eServerEncrypt(byte[] bytes, IoSession session) throws Exception {
//		
//		XCE2EServer server = (XCE2EServer) session.getAttribute("ENVELOP.SERVER");
//		return (new ByteMessage(server.encryptServer(bytes)));
//	}
//
//	public static byte[] e2eServerDecrypt(byte[] bytes, IoSession session) throws Exception {
//
//		XCE2EServer server = (XCE2EServer) session.getAttribute("ENVELOP.SERVER");
//		return (server.decryptServer(bytes));
//	}
//	public static ByteMessage e2eClientEncrypt(byte[] bytes, IoSession session) throws Exception {
//		
//		XCE2EClient client = (XCE2EClient) session.getAttribute("ENVELOP.CLIENT");
//		return (new ByteMessage(client.encryptClient(bytes)));
//	}
//
//	public static byte[] e2eClientDecrypt(byte[] bytes, IoSession session) throws Exception {
//
//		XCE2EClient client = (XCE2EClient) session.getAttribute("ENVELOP.CLIENT");
//		return (client.decryptClient(bytes));
//	}	
//}
