Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1.             var keyId = "ee207722-3955-4158-95e3-d301c64513a9";
  2.             var profileName = "local-b2e-instituicao";
  3.  
  4.             var credentials = new BasicAWSCredentials("local", "local");
  5.            
  6.             var kmsConfig = new AmazonKeyManagementServiceConfig
  7.             {
  8.                 ServiceURL = "http://localhost:4599",
  9.                 // RegionEndpoint = RegionEndpoint.USEast1,
  10.                 // UseHttp = true,
  11.  
  12.             };
  13.             var s3Config = new AmazonS3CryptoConfiguration
  14.             {
  15.                 ServiceURL = "http://localhost:5002",
  16.                 // RegionEndpoint = RegionEndpoint.USEast1,
  17.                 // ForcePathStyle = true,
  18.                 // UseHttp = true
  19.             };
  20.  
  21.    
  22.             var helper = new AwsKmsHelper(credentials, kmsConfig, s3Config);
  23.  
  24.             var str = "localhost|CreditoBackOfficeReplicacao|sa|abc123##";
  25.             helper.Encrypt("b2eCredentials", profileName, str, keyId);
  26.  
  27.             var result = helper.Desencrypt("b2eCredentials", profileName, keyId);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement