I want to encrypt a file without being asked for a password, by specifying the password in the code.
I tried
(setq my-context (epg-make-context))
(epg-context-set-passphrase-callback
my-context (lambda (&rest _ignore) "my-password"))
(epg-encrypt-file my-context "file.txt" nil "file.bin")
and I was still asked for a password.
PS. Please do not tell me that this is not secure (I know) and that I should use gnupg-agent
(I
already do).