Esempio n. 1
0
        /// <summary>
        /// Decrypts data using the provided private key.
        /// </summary>
        /// <exception cref="T:System.ArgumentNullException">data or privateKey is null.</exception>
        public Data Decrypt(Data data, PrivateKey privateKey)
        {
            if (data == null) throw new ArgumentNullException("data");
             if (privateKey == null) throw new ArgumentNullException("privateKey");

             _rsa.ImportParameters(privateKey.ToParameters());
             return DecryptPrivate(data);
        }
Esempio n. 2
0
 /// <summary>
 /// Decrypts data using the default private key.
 /// </summary>
 /// <exception cref="T:System.ArgumentNullException">data is null.</exception>
 public Data Decrypt(Data data)
 {
     var privateKey = new PrivateKey();
      privateKey.LoadFromConfig();
      return Decrypt(data, privateKey);
 }