SshKeys

object SshKeys(source)

Key management utilities for SSH private keys.

Provides decoding/encoding of private keys in PEM, PKCS#8, and OpenSSH formats, and Ed25519 JCA provider registration for platforms that lack native support.

Functions

Link copied to clipboard
fun decodePemPrivateKey(pem: String, password: String? = null): KeyPair

Decode a private key from PEM, PKCS#8, or OpenSSH format.

Link copied to clipboard
fun encodeOpenSshPrivateKey(keyPair: KeyPair, password: String? = null): String

Encode a KeyPair to OpenSSH format (BEGIN OPENSSH PRIVATE KEY).

Link copied to clipboard
fun encodePemPrivateKey(keyPair: KeyPair, password: String? = null): String

Encode a KeyPair to PEM format.

Link copied to clipboard

Ed25519 support is now selected automatically without changing the global JCE provider list.