public void EndSession(string sessionIdentifier) { SecureSession session = SecureSession.Get(sessionIdentifier); session.Delete(); Log.AddEntry("EndSession: Session {0} was deleted", sessionIdentifier); }
public static EncryptedTokenValidationStatus ValidateEncryptedToken(NameValueCollection headers, string plainPost, bool usePkcsPadding = false) { SecureSession session = SecureSession.Get(headers); EncryptedValidationToken token = ReadEncryptedValidationToken(headers); return(ValidateEncryptedToken(session, token, plainPost, usePkcsPadding)); }
/// <summary> /// Establish a secure session /// </summary> /// <returns></returns> public SecureChannelMessage <ClientSessionInfo> InitSession(Instant instant) { SecureSession session = SecureSession.Get(HttpContext, instant); ClientSessionInfo result = GetClientSessionInfo(session); SetSessionCookie(session); return(new SecureChannelMessage <ClientSessionInfo>(result)); }
public SecureChannelMessage SetSessionKey(SetSessionKeyRequest request) { SecureChannelMessage result = new SecureChannelMessage(true); try { SecureSession session = SecureSession.Get(HttpContext); session.SetSymmetricKey(request); } catch (Exception ex) { result = new SecureChannelMessage(ex); } return(result); }
public string TestSessionKey(string cipher) { string result = ""; try { SecureSession session = SecureSession.Get(HttpContext); result = session.Decrypt(cipher); } catch (Exception ex) { result = ex.Message; } return(result); }