public async Task <KeyView> GetKeybyId(Guid Id) { using (var scope = KeyVaultCompositionRoot.BeginLifetimeScope()) { var mediator = scope.Resolve <IMediator>(); return(await mediator.Send(new GetStorageKeyCommand() { ResourceId = Id })); } }
public async Task AddKey(Guid resourceId, byte[] key, byte[] iv) { using (var scope = KeyVaultCompositionRoot.BeginLifetimeScope()) { var mediator = scope.Resolve <IMediator>(); await mediator.Send(new AddStorageKeyCommand() { IV = iv, Key = key, ResourceId = resourceId }); } }