Example #1
0
 /// <summary>
 /// Decrypt with private key.
 /// </summary>
 /// <param name="keyPharse">keypharse to decrypte private key</param>
 /// <returns>Decrypted session key</returns>
 public byte[] LoadKey(string keyPharse)
 {
     byte [] keyPharseHash = SHA256EncryptionApi.getHashSha256(keyPharse);
     return(RsaEncryptionApi.Decrypte(this.key, this.name, keyPharseHash));
 }
Example #2
0
 /// <summary>
 /// Encrypt with public key and store the session key.
 /// </summary>
 /// <param name="key">Key to be stored in user container.</param>
 public void StoreKey(byte[] key)
 {
     this.key = RsaEncryptionApi.Encrypte(key, this.name);
 }