Using CFExecute, is there a way to pass multiple o...
# adobe
p
Using CFExecute, is there a way to pass multiple options? I'm trying to set up gpg, but it wants to be interactive and I just need to feed it the commands in one go...
b
@Patrick S Not sure what you're asking. are you wanting to pass more than one argument, or pipe input on the standard input of the process (interactive)
Maybe you can start by showing what you'd run from the OS command line to perform the same operation
p
When I run "gpg --edit-key KEYNAME" it provides some details, and a prompt to run commands
b
Have you googled how to do what you want in a single command?
I can help you with cfexecute, but it sounds like you don't actually know what command you want to run yet, which more of a gpg question, not a CF question
p
I have been searching all over <sigh>
b
Under the "Trust the keys noninteractive in batch" section it shows using the edit key flag
and piping keyboard input
Now, that seems like a terrible way to do it, so I'd keep looking to see if there's a better way, but that presents at least one option
A few results down on Google, I see this https://gist.github.com/woods/8970150
Seems promising
p
I'll take a look... I'm kinda shocked that CF doesn't do anything with PGP
b
--batch
seems to be a key thing to research
p
Yeah, I was using it
I got it to work for decrypting, but encrypting is being annoying
b
Well again, I'd find the command that works outside of ColdFusion (using GPG forums and docs) and once you know what to run, the cfexuecte portion should come easy.
Unfortunately, I'm not familiar with the gpg CLI. Perhaps someone else who is can chime in.
p
It is so close, but hopefully I'll figure it out soon
Finally got it...
gpg --output "FILENAME.pgp" --encrypt --recipient KEYNAME --trust-model always "FILENAME"
worked
👍 1
Thanks for the help! I'd been banging my head against the wall for a while