How to delete one GPG security key by command prompt in JAVA

1k Views Asked by At

we can execute the commands by java application by Process p = Runtime.getRuntime().exec("command here") But while running the "gpg --delete-key abc.gpg" in cmd it's asking confirmation are you sure you want to delete this key (y/N) . Here I am bit confused how to implement so that it should accept the next char for the final output.

I am very new to this kind of gpg.Any early help is appreciated. Thanks in advance.

1

There are 1 best solutions below

0
On

Hi guys Finally I got the command to do it in a single slot of command to do it

gpg --batch --yes --delete-key key_name