コード例 #1
0
        public TestHelper Get_XAdES(SignerIdentifier signer)
        {
            Assert_state(_status);

            var xades = _directClient.GetXades(_status.GetSignatureFor(signer).XadesReference).Result;

            Assert.True(xades.CanRead);
            return(this);
        }
コード例 #2
0
        public async Task GetXadesAndPades()
        {
            ClientConfiguration clientConfiguration = null; //As initialized earlier
            var directClient = new DirectClient(clientConfiguration);
            JobStatusResponse jobStatusResponse = null;     // Result of requesting job status

            if (jobStatusResponse.Status == JobStatus.CompletedSuccessfully)
            {
                var padesByteStream = await directClient.GetPades(jobStatusResponse.References.Pades);
            }

            var signature = jobStatusResponse.GetSignatureFor(new PersonalIdentificationNumber("00000000000"));

            if (signature.Equals(SignatureStatus.Signed))
            {
                var xadesByteStream = await directClient.GetXades(signature.XadesReference);
            }
        }
        public async Task GetXadesAndPades()
        {
            ClientConfiguration clientConfiguration = null; //As initialized earlier
            var directClient = new DirectClient(clientConfiguration);
            JobStatusResponse jobStatusResponse = null; // Result of requesting job status

            switch (jobStatusResponse.Status)
            {
                case JobStatus.Rejected:
                    //Signature job was rejected by the signer. Xades and Pades cannot be requested.
                    break;
                case JobStatus.Failed:
                    //Signature job failed, Xades and Pades cannot be requested.
                    break;
                case JobStatus.Signed:
                    var xadesByteStream = await directClient.GetXades(jobStatusResponse.References.Xades);
                    var padesByteStream = await directClient.GetPades(jobStatusResponse.References.Pades);
                    break;
            }
        }
        public async Task GetXadesAndPades()
        {
            ClientConfiguration clientConfiguration = null; //As initialized earlier
            var directClient = new DirectClient(clientConfiguration);
            JobStatusResponse jobStatusResponse = null; // Result of requesting job status

            if (jobStatusResponse.Status == JobStatus.CompletedSuccessfully)
            {
                var padesByteStream = await directClient.GetPades(jobStatusResponse.References.Pades);
            }

            var signature = jobStatusResponse.GetSignatureFrom(new PersonalIdentificationNumber("12345678910"));

            if (signature.Equals(SignatureStatus.Signed))
            {
                var xadesByteStream = await directClient.GetXades(signature.XadesReference);
            }
        }