public ActionResult Index() {

			var signatureStarter = new FullXmlSignatureStarter(Util.GetRestPkiClient());
			signatureStarter.SetSignaturePolicy(StandardXmlSignaturePolicies.PkiBrazil.NFePadraoNacional);
			signatureStarter.SetXml(Util.GetSampleNFeContent());
			signatureStarter.SetSecurityContext(new Guid("7f1972f4-ec15-4b0d-a2e6-97766e54c439"));
			//signatureStarter.SetToSignElementId("NFe35141214314050000662550010001084271182362300");

			//var idResolutionTable = new XmlIdResolutionTable();
			//idResolutionTable.SetElementIdAttribute("infNFe", "http://www.portalfiscal.inf.br/nfe", "guid");
			//idResolutionTable.AddGlobalIdAttribute("guid");
			//signatureStarter.SetIdResolutionTable(idResolutionTable);

			// Call the StartWithWebPki() method, which initiates the signature. This yields the token, a 43-character
			// case-sensitive URL-safe string, which identifies this signature process. We'll use this value to call the
			// signWithRestPki() method on the Web PKI component (see javascript on the view) and also to complete the signature
			// on the POST action below (this should not be mistaken with the API access token).
			var token = signatureStarter.StartWithWebPki();

			// The token acquired above can only be used for a single signature attempt. In order to retry the signature it is
			// necessary to get a new token. This can be a problem if the user uses the back button of the browser, since the
			// browser might show a cached page that we rendered previously, with a now stale token. To prevent this from happening,
			// we call the method SetNoCacheHeaders() (in BaseController) which sets HTTP headers to prevent caching of the page.
			base.SetNoCacheHeaders();

			// Render the signature page with the token obtained from REST PKI
			return View(new XmlSignatureModel() {
				Token = token
			});
		}
        public async Task <ActionResult> Index()
        {
            // Instantiate the XmlElementSignatureStarter class, responsible for receiving the signature
            // elements and start the signature process.
            var signatureStarter = new FullXmlSignatureStarter(Util.GetRestPkiClient());

            // Set the XML to be signed, a sample XML Document.
            signatureStarter.SetXml(StorageMock.GetSampleXmlDocumentPath());

            // Set the signature policy.
            signatureStarter.SetSignaturePolicy(StandardXmlSignaturePolicies.XadesBes);

            // Set the security context to be used to determine trust in the certificate chain. We have
            // encapsulated the security context choice on Util.cs.
            signatureStarter.SetSecurityContext(Util.GetSecurityContextId());

            // Set the location on which to insert the signature node. If the location is not specified, the
            // signature will appended to the root element (which is most usual with enveloped signatures).
            var nsm = new NamespaceManager();

            nsm.AddNamespace("ls", "http://www.lacunasoftware.com/sample");
            signatureStarter.SetSignatureElementLocation("//ls:signaturePlaceholder", XmlInsertionOptions.AppendChild, nsm);

            // Call the StartWithWebPki() method, which initiates the signature. This yields the token,
            // a 43-character case-sensitive URL-safe string, which identifies this signature process. We'll
            // use this value to call the signWithRestPki() method on the Web PKI component (see
            // signature-form.js) and also to complete the signature on the POST action below (this should
            // not be mistaken with the API access token).
            var token = await signatureStarter.StartWithWebPkiAsync();

            // The token acquired above can only be used for a single signature attempt. In order to retry
            // the signature it is necessary to get a new token. This can be a problem if the user uses the
            // back button of the browser, since the browser might show a cached page that we rendered
            // previously, with a now stale token. To prevent this from happening, we call the method
            // SetNoCacheHeaders() (in BaseController) which sets HTTP headers to prevent caching of the
            // page.
            base.SetNoCacheHeaders();

            // Render the signature page with the token obtained from REST PKI.
            return(View(new SignatureModel()
            {
                Token = token
            }));
        }
        public ActionResult Index()
        {
            // Instantiate the XmlElementSignatureStarter class, responsible for receiving the signature elements and start the
            // signature process
            var signatureStarter = new FullXmlSignatureStarter(Util.GetRestPkiClient());

            // Set the XML to be signed, a sample XML Document
            signatureStarter.SetXml(Util.GetSampleXmlDocument());

            // Set the signature policy
            signatureStarter.SetSignaturePolicy(StandardXmlSignaturePolicies.XadesBes);

            // Set a SecurityContext to be used to determine trust in the certificate chain
            signatureStarter.SetSecurityContext(StandardSecurityContexts.PkiBrazil);
            // Note: By changing the SecurityContext above you can accept only certificates from a certain PKI, for instance,
            // ICP-Brasil (\Lacuna\StandardSecurityContexts::PKI_BRAZIL).

            // Set the location on which to insert the signature node. If the location is not specified, the signature will appended
            // to the root element (which is most usual with enveloped signatures).
            var nsm = new NamespaceManager();

            nsm.AddNamespace("ls", "http://www.lacunasoftware.com/sample");
            signatureStarter.SetSignatureElementLocation("//ls:signaturePlaceholder", Api.XmlSignature.XmlInsertionOptions.AppendChild, nsm);

            // Call the StartWithWebPki() method, which initiates the signature. This yields the token, a 43-character
            // case-sensitive URL-safe string, which identifies this signature process. We'll use this value to call the
            // signWithRestPki() method on the Web PKI component (see javascript on the view) and also to complete the signature
            // on the POST action below (this should not be mistaken with the API access token).
            var token = signatureStarter.StartWithWebPki();

            // The token acquired above can only be used for a single signature attempt. In order to retry the signature it is
            // necessary to get a new token. This can be a problem if the user uses the back button of the browser, since the
            // browser might show a cached page that we rendered previously, with a now stale token. To prevent this from happening,
            // we call the method SetNoCacheHeaders() (in BaseController) which sets HTTP headers to prevent caching of the page.
            base.SetNoCacheHeaders();

            // Render the signature page with the token obtained from REST PKI
            return(View(new XmlSignatureModel()
            {
                Token = token
            }));
        }
		public ActionResult Index() {

			// Instantiate the XmlElementSignatureStarter class, responsible for receiving the signature elements and start the
			// signature process
			var signatureStarter = new FullXmlSignatureStarter(Util.GetRestPkiClient());

			// Set the XML to be signed, a sample XML Document
			signatureStarter.SetXml(Util.GetSampleXmlDocument());

			// Set the signature policy
			signatureStarter.SetSignaturePolicy(StandardXmlSignaturePolicies.XadesBes);

			// Set a SecurityContext to be used to determine trust in the certificate chain
			signatureStarter.SetSecurityContext(StandardSecurityContexts.PkiBrazil);
			// Note: By changing the SecurityContext above you can accept only certificates from a certain PKI, for instance,
			// ICP-Brasil (\Lacuna\StandardSecurityContexts::PKI_BRAZIL).

			// Set the location on which to insert the signature node. If the location is not specified, the signature will appended
			// to the root element (which is most usual with enveloped signatures).
			var nsm = new NamespaceManager();
			nsm.AddNamespace("ls", "http://www.lacunasoftware.com/sample");
			signatureStarter.SetSignatureElementLocation("//ls:signaturePlaceholder", Api.XmlSignature.XmlInsertionOptions.AppendChild, nsm);

			// Call the StartWithWebPki() method, which initiates the signature. This yields the token, a 43-character
			// case-sensitive URL-safe string, which identifies this signature process. We'll use this value to call the
			// signWithRestPki() method on the Web PKI component (see javascript on the view) and also to complete the signature
			// on the POST action below (this should not be mistaken with the API access token).
			var token = signatureStarter.StartWithWebPki();

			// The token acquired above can only be used for a single signature attempt. In order to retry the signature it is
			// necessary to get a new token. This can be a problem if the user uses the back button of the browser, since the
			// browser might show a cached page that we rendered previously, with a now stale token. To prevent this from happening,
			// we call the method SetNoCacheHeaders() (in BaseController) which sets HTTP headers to prevent caching of the page.
			base.SetNoCacheHeaders();

			// Render the signature page with the token obtained from REST PKI
			return View(new XmlSignatureModel() {
				Token = token
			});
		}