private void SignDocuments(Preservation preservation, ISignService _signService, Models.ArubaSignModel model) { string currentFilePath = Directory.GetFiles(preservation.Path, "IPDA*.xml").FirstOrDefault(); if (currentFilePath != null) { //get file content byte[] content = System.IO.File.ReadAllBytes(currentFilePath); //sign document with aruba automatic VecompSoftware.Sign.ArubaSignService.ArubaSignModel arubaModel = new VecompSoftware.Sign.ArubaSignService.ArubaSignModel() { DelegatedDomain = model.DelegatedDomain, DelegatedPassword = model.DelegatedPassword, DelegatedUser = model.DelegatedUser, OTPPassword = model.OTPPassword, OTPAuthType = model.OTPAuthType, User = model.User, CertificateId = model.CertificateId, TSAUser = model.TSAUser, TSAPassword = model.TSAPassword }; content = _signService.SignDocument(arubaModel, content, Path.GetFileName(currentFilePath), true); //save signed file back to disk ByteArrayToFile(currentFilePath, content); //update CloseDate field so that we can close the preservation _preservationService.ClosePreservation(preservation.IdPreservation); } }
public void SignDocument([FromForm] SigningDocument file) { file.Location = "Varaždin"; file.destinationSave = @"C:\Users\CSVarazdin\Documents\GitHub\TimeRedistribution\MedApp\SecretToken\"; file.CertificatDestination = @"C:\Users\CSVarazdin\Documents\GitHub\TimeRedistribution\MedApp\SecretToken\mediion.com.p12"; file.Password = "******"; _signService.SignDocument(file); //return Ok(); }