public CommonResponse LoadCred(string password, int pin, string guid)
        {
            try
            {
                if (!CheckAuth(password, pin))
                {
                    return(InvalidAuthResponse());
                }

                var response = new CredInfoResponse();

                response.Cred = config.LoadCred(guid);

                return(response);
            }
            catch (Exception ex)
            {
                return(ErrorResponse(ex.Message));
            }
        }
Exemple #2
0
        public CommonResponse LoadCred(string password, int pin, string guid)
        {
            try
            {
                if (!CheckAuth(password, pin))
                {
                    return(InvalidAuthResponse());
                }

                var response = new CredInfoResponse();

                response.Cred = config.LoadCred(guid);
                if (response.Cred.Level > CurrentLevel(password, pin))
                {
                    return(InvalidAuthResponse());                                                   // can't access higher level of credentials
                }
                return(response);
            }
            catch (Exception ex)
            {
                return(ErrorResponse(ex.Message));
            }
        }