Пример #1
0
 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
         }));
     }
 }
Пример #2
0
 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
         });
     }
 }