public async Task <IActionResult> Sign([FromBody] SignRequest signRequest, CancellationToken token) { SignRequestResponse response = await _signingService.Sign(signRequest, token); if (response == null) { return(BadRequest()); } return(Ok(response)); }
protected override void ProcessRecord() { base.ProcessRecord(); try { var sourcesToDestination = MapSourceToDestination(GetFiles()); var signer = new SigningService(Credential.UserName, Credential.Password.ToUnsecureString(), sourcesToDestination, ServiceUrl, MessageHandler, ProgressHandler); signer.Sign(StrongName); } catch (AggregateException ae) { this.WriteErrorsAndThrowOnLast( ae.Flatten().InnerExceptions.Select(LazyCreateError)); } catch (Exception e) { ThrowTerminatingError(LazyCreateError(e)); } }
public override bool Execute() { try { //can we run Execute twice? I don't know so we'll say reset the CTS here _source = new CancellationTokenSource(); SetCredentials(); var sourcesToDestination = MapSourcesToDestination().ToArray(); Log.LogMessage(sourcesToDestination.First().Destination.FullName); var signer = new SigningService(UserName, Password, sourcesToDestination, ServiceUrl, MessageHandler, ProgressHandler); signer.Sign(StrongName, _source); } catch (Exception e) { Log.LogErrorFromException(e, true, true, null); } return(!Log.HasLoggedErrors); }