KB Article #179829
Impossible to import a SSH2 public key
Problem
SFTP transfer from CFT to ST,
Public key import using command below:
PKIUTIL PKIKEY ID=PUBSSHKEY, IKFORM=SSH, IKNAME=./My_PUB_SSH_KEY.txt, MODE=CREATE
Get error below:
PKIU26E PKIKEY _ Error ( Parsing error on Certificate or Key {15025/0} (Failed to add private key (ikform=PEM,
keytype=KEY_SSH_RSA_PUB, ikname=./My_PUB_SSH_KEY.txt,)) )
Resolution
SSH1 format won't be handled (deprecated anyway) while SSH2 public format works fine.
In the reported issue, the problem was about the free comment in the public key data:
---- BEGIN SSH2 PUBLIC KEY ----
Comment: "rsa-key-20181022" <=== this line
AAAAB3NzaC1yc2EAAAABJQAAAQEApPKm5TpaAibNjA2wMlIQ4dee8OtqM6lMiUHs
...
---- END SSH2 PUBLIC KEY ----
Note:
The "free comment" can be added in ANY key (RSA, public RSA, PKCS#8...) according to the standard, but leads to an error in most implementation.
We do not handle this line, with any key.
It should be indicated in the documentation, or we may handle this.
As it is a (almost) free line, we'll need to check the RFC to see how to handle this.
For me, best solution would be to state in the documentation that we don't handle this format.