Access secret key from C# asp.net website using Process class

DW Brown info at dwbrown.biz
Sun Feb 23 20:24:39 CET 2020


I have a public and private key on a Windows web server that I am able 
to use without problems using DOS commands. I can do import, encrypt, 
decrypt, list-secret-keys etc. I am trying to do the same from a web 
page. From a C# asp.net web page using the Process class, I can import a 
public key and encrypt a file. But I can not decrypt a file from the web 
page. From the web page, when I do a --list-keys, it only lists the 
public keys. From the web page, when I do a --list-secret-keys, it lists 
nothing.

When I try to decrypt, the error output is:
gpg: encrypted with 2048-bit RSA key, ID AAAAAAAAAAAAAAAA, created 
2019-12-06 "Company A " gpg: decryption failed: No secret key

My gpg cmd is:
gpg --batch --trust-model always --pinentry-mode loopback --passphrase 
"xxxxxxxxxx" --output "D:\Websites\test.txt" --decrypt 
"D:\Websites\test.pgp"

How can I access the secret-key from the web page?

thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20200223/1914b31e/attachment.html>


More information about the Gnupg-users mailing list