/// <inheritdoc /> public async Task <List <string> > ListBackupsAsync(IAgentContext context) { var provRecord = await provisioningService.GetProvisioningAsync(context.Wallet); var publicKey = provRecord.GetTag("backup_key"); if (string.IsNullOrEmpty(publicKey)) { throw new ArgumentException("No such key exists"); } var listBackupsMessage = new ListBackupsAgentMessage() { BackupId = publicKey, }; var connection = await GetMediatorConnectionAsync(context).ConfigureAwait(false); if (connection == null) { throw new AriesFrameworkException(ErrorCode.RecordNotFound, "Couldn't locate a connection to mediator agent"); } var response = await messageService.SendReceiveAsync <ListBackupsResponseAgentMessage>(context.Wallet, listBackupsMessage, connection).ConfigureAwait(false); return(response.BackupList.ToList()); }
/// <inheritdoc /> public async Task <List <long> > ListBackupsAsync(IAgentContext context) { var publicKey = await Did.KeyForLocalDidAsync(context.Wallet, InternalBackupDid); var listBackupsMessage = new ListBackupsAgentMessage() { BackupId = publicKey, }; var connection = await GetMediatorConnectionAsync(context).ConfigureAwait(false); if (connection == null) { throw new AriesFrameworkException(ErrorCode.RecordNotFound, "Couldn't locate a connection to mediator agent"); } var response = await messageService.SendReceiveAsync <ListBackupsResponseAgentMessage>(context.Wallet, listBackupsMessage, connection).ConfigureAwait(false); return(response.BackupList.ToList()); }