ExchangeSharp icon indicating copy to clipboard operation
ExchangeSharp copied to clipboard

keys -m create --key-stdin??

Open jdx-john opened this issue 4 years ago • 5 comments
trafficstars

Readme.md says I should consult the console app for examples how to do authentication, but the keys option is very light on any detail what I should be passing and in what order (I think public, private keys in that order).

I tried to use --key-stdin and now my console is stuck, whatever I type in it just keeps wanting more lines. Even standard ctrl-c/x keys won't terminate it.

No idea what I'm really supposed to be doing, how I even tell if it's worked. What is the correct usage?

jdx-john avatar Jul 27 '21 18:07 jdx-john

(I got it to work without using --key-stdin but I'd still like to know)

jdx-john avatar Jul 27 '21 19:07 jdx-john

CTRL+Z ends the input editor :) So, the order is as you thought? I'm looking for help setting up the keys file...

restlessarcher avatar Dec 25 '21 01:12 restlessarcher

I couldn't get the console input working either -- CryptoUtility finds " API key has invalid characters " no matter if I use ^Z on the same line as the keys or the next line after an [Enter]...

restlessarcher avatar Dec 25 '21 02:12 restlessarcher

Yes, there needs to be more documentation about this. Even the console help doesn't really explain how to do it. I tried using keys -m create --key-stdin, which took it to a prompt. I pasted in my public key, enter, the private key, enter, the passphrase, enter, Ctrl+Z, enter. The Ctrl+Z followed by enter at the end was the only way I could get the prompt to stop. After that it did generate some kind of file, but when I try to use it, an exception is thrown, saying the file should include at least a public key, private key, and optional passphrase.

StarringLara avatar Jan 30 '22 02:01 StarringLara

I got it to work by launching exchange-sharp.exe in interactive mode and creating the file using --key-list instead of --key-stdin. The command (after landing in interactive mode) was keys -m create --key-list public-key,private-key,passphrase. It created a keys.bin file that I was able to load. This is better than having to resort to the LoadAPIKeysUnsecure method.

StarringLara avatar Jan 30 '22 04:01 StarringLara