public Dictionary <string, string> GetAliasList(ref authTokenType token, string keySpace)
        {
            xmCryptoService client = new xmCryptoService();

            try
            {
                Dictionary <string, string> dic = new Dictionary <string, string>();
                string tipo = string.Empty;
                getAliasListResponse respuesta    = null;
                getAliasList         getAliasList = new getAliasList();

                getAliasList.AuthToken = token;
                getAliasList.KeySpace  = keySpace;

                respuesta = client.getAliasList(getAliasList);
                token     = respuesta.AuthToken;
                foreach (var alias in respuesta.ObjectAlias)
                {
                    var info = new getObjectInfo {
                        ObjectAlias = alias, AuthToken = respuesta.AuthToken
                    };
                    getObjectInfoResponse resp = client.getObjectInfo(info);
                    respuesta.AuthToken = resp.AuthToken;
                    if (resp.KeyInfo != null && resp.KeyInfo.ItemsElementName[0] == ItemsChoiceType1.X509Data)
                    {
                        tipo = "Certificado";
                    }
                    else
                    {
                        tipo = resp.CryptoObject.Policy[1].PolicyValue;
                        if (tipo == "Private Key")
                        {
                            tipo = "Llave Privada";
                        }
                        else
                        {
                            tipo = "Llave Pública";
                        }
                    }
                    dic.Add(alias, tipo);
                }

                token = respuesta.AuthToken;
                return(dic);
            }
            catch (Exception ee)
            {
                Log.Error("Error al intentar realizar login: " + ee);
                return(null);
            }
        }
        public List <string> GetAliasSimetricas(ref authTokenType token, string keySpace)
        {
            xmCryptoService client = new xmCryptoService();

            try
            {
                List <string>        dic          = new List <string>();
                string               tipo         = string.Empty;
                getAliasListResponse respuesta    = null;
                getAliasList         getAliasList = new getAliasList();

                getAliasList.AuthToken = token;
                getAliasList.KeySpace  = keySpace;

                respuesta = client.getAliasList(getAliasList);

                foreach (var alias in respuesta.ObjectAlias)
                {
                    var info = new getObjectInfo {
                        ObjectAlias = alias, AuthToken = respuesta.AuthToken
                    };
                    getObjectInfoResponse resp = client.getObjectInfo(info);
                    respuesta.AuthToken = resp.AuthToken;
                    if (resp.CryptoObject.Policy != null && resp.CryptoObject.Policy[1].PolicyValue == "Secret Key")
                    {
                        dic.Add(alias);
                    }
                }
                token = respuesta.AuthToken;
                return(dic);
            }
            catch (Exception ee)
            {
                Log.Error("Error al intentar realizar login: " + ee);
                return(null);
            }
        }