/// <summary>
        /// Verify the Document with Text Signatures
        /// </summary>
        /// <param name="request">Request. <see cref="PostVerificationTextRequest" /></param>
        /// <returns><see cref="VerifiedDocumentResponse"/></returns>
        public VerifiedDocumentResponse PostVerificationText(PostVerificationTextRequest request)
        {
            // verify the required parameter 'name' is set
            if (request.Name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling PostVerificationText");
            }

            // create path and map variables
            var resourcePath = this.configuration.GetApiRootUrl() + "/signature/{name}/verification/text";

            resourcePath = Regex
                           .Replace(resourcePath, "\\*", string.Empty)
                           .Replace("&amp;", "&")
                           .Replace("/?", "?");
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "name", request.Name);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "password", request.Password);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "folder", request.Folder);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "storage", request.Storage);
            var postBody = SerializationHelper.Serialize(request.VerifyOptionsData); // http body (model) parameter
            var response = this.apiInvoker.InvokeApi(
                resourcePath,
                "POST",
                postBody,
                null,
                null);

            if (response != null)
            {
                return((VerifiedDocumentResponse)SerializationHelper.Deserialize(response, typeof(VerifiedDocumentResponse)));
            }

            return(null);
        }
Beispiel #2
0
        public void PostVerifyTextTest_PdfStamp()
        {
            var file = TestFiles.SignedTextStamp_Pdf01;
            var verifyOptionsData = new PdfVerifyTextOptionsData()
            {
                DocumentPageNumber = 1,
                Text = "1234567890",
                SignatureImplementation = PdfVerifyTextOptionsData.SignatureImplementationEnum.Stamp,
                VerifyAllPages          = false
            };
            var request = new PostVerificationTextRequest
            {
                Name = file.FileName,
                VerifyOptionsData = verifyOptionsData,
                Password          = null,
                Folder            = file.Folder
            };

            var response = SignatureApi.PostVerificationText(request);

            AssertResponse(response);
        }