Access secret key from C# website using Process class

DW Brown info at
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# 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 

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 

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Gnupg-users mailing list