ファイルの暗号化と復号化に、didisoft の OpenPGP を使用しています。暗号化されたファイルと、暗号化キーに対応する秘密キーがあります。しかし、DecryptFile () メソッドを使用しようとすると、ヌル ポインター例外が発生します。何が問題なのかわかりません。どんな助けでも大歓迎です。コード:
public void decryptFile(string filename, string destPath)
string password = "xxx";
string encFile = System.IO.Path.GetTempPath() + filename;
string keyFile = ConfigurationManager.AppSettings["DecryptKeyFile"].ToString();
PGPLib pgpDecrypter = new PGPLib();
File.Create(destPath + filename);
string a = pgpDecrypter.DecryptFile(encFile, keyFile, password, destPath+filename); // I get the error on this line