Example #1
0
 /// <summary>
 /// Decrypt PrivateKey from KeyStoreV3 json string with password
 /// </summary>
 /// <exception cref="KdfException"></exception>
 public static PrivateKey DecryptKeyStoreV3(string json, string password)
 {
     try
     {
         return(PbkdfService.DecryptKey(json, password));
     }
     catch (KdfException e)
     {
         blog.error($"Exception! e={e.ErrorMessage}");
         throw;
     }
 }
Example #2
0
 /// <summary>
 /// Encrypt PrivateKey to KeyStoreV3 json string with password using Pbkdf2
 /// </summary>
 /// <exception cref="KdfException"></exception>
 public static string EncryptKeyStoreV3AsJson(PrivateKey key, string password, Pbkdf2Params kdfParams)
 {
     try
     {
         return(PbkdfService.EncryptKey(key, password, kdfParams).ToJson());
     }
     catch (KdfException e)
     {
         blog.error($"WrongHmacException! e={e.ErrorMessage}");
         throw;
     }
 }