Exemple #1
0
        /// <summary>
        /// Add an eSeal to the document via the e-contract service.
        /// </summary>
        /// <see cref="Seal(Document, SignatureRequestProperties)"/>
        public async Task <Document> SealAsync(Document document, SignatureRequestProperties properties)
        {
            if (document == null)
            {
                throw new ArgumentNullException("document");
            }

            var           client          = CreateDSSPClient();
            var           request         = CreateSealRequest(document, properties);
            signResponse1 responseWrapper = await client.signAsync(request);

            return(ProcessResponseWithSignedDoc(responseWrapper.SignResponse));
        }
Exemple #2
0
        /// <summary>
        /// Downloads the document that was uploaded before and signed offline.
        /// </summary>
        /// <see cref="DownloadDocument(Dssp2StepSession)"/>
        public async Task <Document> DownloadDocumentAsync(Dssp2StepSession session)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }

            var           client           = CreateDSSPClient();
            var           downloadRequest  = CreateDownloadRequest(session);
            signResponse1 downloadResponse = await client.signAsync(downloadRequest);

            return(ProcessResponseWithSignedDoc(downloadResponse.SignResponse));
        }
Exemple #3
0
        /// <summary>
        /// Uploads a document to e-Contract, asynchronously.
        /// </summary>
        /// <see cref="UploadDocument"/>
        public async Task <DsspSession> UploadDocumentAsync(Document document)
        {
            if (document == null)
            {
                throw new ArgumentNullException("document");
            }

            var           client          = CreateDSSPClient();
            var           request         = CreateAsyncSignRequest(document, out var clientNonce);
            signResponse1 responseWrapper = await client.signAsync(request);

            return(ProcessAsyncSignResponse(responseWrapper.SignResponse, clientNonce));
        }
Exemple #4
0
        /// <summary>
        /// Uploads a document to e-Contract, asynchronously.
        /// </summary>
        /// <see cref="UploadDocumentFor2Step(Document, SignatureRequestProperties)"/>
        public async Task <Dssp2StepSession> UploadDocumentFor2StepAsync(Document document, SignatureRequestProperties properties)
        {
            if (document == null)
            {
                throw new ArgumentNullException("document");
            }
            if (!(Signer?.HasPrivateKey ?? false && Signer?.PrivateKey is RSACryptoServiceProvider))
            {
                throw new InvalidOperationException("Singner must be set and have a private key");
            }

            var           client   = CreateDSSPClient();
            var           request  = Create2StepSignRequest(document, properties);
            signResponse1 response = await client.signAsync(request);

            return(Process2StepSignResponse(response.SignResponse));
        }