I’m doing publicKey.getEncoded(), then appending “ssh-rsa” to the front, then base64 encoding it. Then I add the SSH2 header/footer. But it won’t decode…
I’m doing publicKey.getEncoded(), then appending ssh-rsa to the front, then base64 encoding it. Then
Share
Java public keys are encoded as a standard X.509 SubjectPublicKeyInfo structure.
SSH2 uses its own simple format. Base-64 encode the result of the
encodemethod shown below, and affix the necessary SSH2 header and footer.See this answer for converting the other direction, from OpenSSH to Java.