示例#1
0
        public void EndSession(string sessionIdentifier)
        {
            SecureSession session = SecureSession.Get(sessionIdentifier);

            session.Delete();
            Log.AddEntry("EndSession: Session {0} was deleted", sessionIdentifier);
        }
示例#2
0
        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));
        }
示例#3
0
        /// <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));
        }
示例#4
0
        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);
        }
示例#5
0
        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);
        }