Create SSH User Identity Key in B2B Integrator using API
Alex Chia 270004PRFF Visits (3186)
NOTE: This API service is equivalent to Trading Partner > SSH > User Identity Key > Check In option in the dashboard user interface and not the Create option.
The Rest API covers each required field pretty straight forward except on the field of Private Key Data.
Now, you may wonder what that mean and reading my note above, It means that we need to supply a private key string that is in a Base 64-encoded format.
Currently, there is no B2B Integrator script/utility/tool that can generate the self-signed SSH private key.
One would need to use a third party ssh private key tool to accomplish this. (i.e. OpenSSH, PuTTYgen, or others)
And if the generated private key string is not in Base 64-encoded format, then, you may use B2B Integrator's Base
Here is some more details on the Base64EncodeDecode script:
Please note that for each new SSH User Identity Key that you want to create in the API, one would need to have different corresponding private key data (Base 64-encoded string) for each SSH User Identity Key.
Below is the illustration of what I tested of the above:
1. Using PuTTYgen to create the needed ssh private key file and convert it to OpenSSH format in order to use it in B2B Integrator:
Update Key Comment and Key Passphrase, click Save Private key
After saving the file, one would need to convert it to OpenSSH format:
Here is my test of the converted ssh private key check-in process in B2B Integrator dashboard user interface:
And the check in process is successful as I didn't get any error message and I can see the key file in the listing below:
Here is the converted file content:
-----BEGIN RSA PRIVATE KEY-----