public async Task <IActionResult> ObterListaSignatureFieldName([FromForm] InputFileDto inputFileDto)
        {
            var inputFile = await Mapper.Map <Task <InputFile> >(inputFileDto);

            ICollection <string> signatureFieldName = await AssinaturaDigitalCore.ObterSignatureFieldName(inputFile);

            return(Ok(new ApiResponse <ICollection <string> >(200, "success", signatureFieldName)));
        }
        public async Task <IActionResult> InputFileByInputFile([FromForm] InputFileDto inputFileDto)
        {
            InputFile inputFile = await Mapper.Map <Task <InputFile> >(inputFileDto);

            var response = await TransformaPdfCore.PdfInfo(inputFile);

            return(Ok(new ApiResponse <PdfInfo>(200, "success", response)));
        }
        public async Task <IActionResult> RemoverAssinaturasDigitais([FromForm] InputFileDto inputFileDto)
        {
            InputFile inputFile = await Mapper.Map <Task <InputFile> >(inputFileDto);

            byte[] documentoSemAssinaturas = await AssinaturaDigitalCore.RemoverAssinaturasDigitais(inputFile);

            return(File(documentoSemAssinaturas, "application/octet-stream"));
        }
        public async Task <IActionResult> ValidarHashDocumento([FromForm] InputFileDto inputFileDto, [FromForm] string hash)
        {
            var inputFile = await Mapper.Map <Task <InputFile> >(inputFileDto);

            var documentoAutentico = await AssinaturaDigitalCore.ValidarHashDocumento(inputFile, hash);

            return(Ok(new ApiResponse <bool>(200, "success", documentoAutentico)));
        }
        public async Task <IActionResult> AdicionarAssinaturaDigital([FromForm] InputFileDto inputFileDto, [FromForm] string signatureFieldName)
        {
            var inputFile = await Mapper.Map <Task <InputFile> >(inputFileDto);

            var documentoAssinado = await AssinaturaDigitalCore.AdicionarAssinaturaDigital(inputFile, signatureFieldName);

            return(File(documentoAssinado, "application/octet-stream"));
        }
Exemplo n.º 6
0
        public async Task <IActionResult> SubstituirExpressaoRegularTexto([FromForm] InputFileDto inputFileDto, [FromForm] IEnumerable <string> expressoesRegulares, [FromForm] string texto)
        {
            InputFile inputFile = await Mapper.Map <Task <InputFile> >(inputFileDto);

            byte[] documentoAssinado = await CarimboCore.SubstituirExpressaoRegularPorTexto(inputFile, expressoesRegulares, texto);

            return(File(documentoAssinado, "application/octet-stream"));
        }
        public async Task <IActionResult> ValidarAssinaturaDigital([FromForm] InputFileDto inputFileDto, [FromForm] bool ignorarExpiradas)
        {
            var inputFile = await Mapper.Map <Task <InputFile> >(inputFileDto);

            var result = await AssinaturaDigitalCore.SignatureValidation(inputFile, ignorarExpiradas);

            return(Ok(new ApiResponse <IEnumerable <CertificadoDigitalDto> >(200, "success", result)));
        }
Exemplo n.º 8
0
        public async Task <IActionResult> CarimboLateral(
            [FromForm] InputFileDto inputFileDto, [FromForm] string texto, [FromForm] Margem margem,
            [FromForm] string cor, [FromForm] int?paginaInicial = null, [FromForm] int?totalPaginas = null
            )
        {
            var inputFile = await Mapper.Map <Task <InputFile> >(inputFileDto);

            var documentoAssinado = await CarimboCore.CarimboLateral(inputFile, texto, 0.01f, margem, cor, paginaInicial, totalPaginas);

            return(File(documentoAssinado, "application/octet-stream"));;
        }
            public async Task <InputFile> Convert(InputFileDto source, Task <InputFile> destination, ResolutionContext context)
            {
                InputFile inputFile = new InputFile();

                if (source?.FileBytes != null)
                {
                    using (var memoryStream = new MemoryStream())
                    {
                        await source.FileBytes.CopyToAsync(memoryStream);

                        inputFile.FileBytes = memoryStream.ToArray();
                        memoryStream.Close();
                    }
                }

                if (source?.FileUrl != null)
                {
                    inputFile.FileUrl = source.FileUrl;
                }

                return(inputFile);
            }