getPublicKey

fun getPublicKey(algorithmName: String, privateKeyData: String, passphrase: String?): AuthPublicKey(source)

Extract the AuthPublicKey from a private key for use with AuthHandler.onPublicKeysNeeded.

Return

The corresponding public key for probing

Parameters

algorithmName

SSH algorithm name (e.g., "ssh-ed25519", "rsa-sha2-256")

privateKeyData

PEM or OpenSSH private key contents

passphrase

Key passphrase, or null if unencrypted


fun getPublicKey(algorithmName: String, privateKeyData: ByteArray, passphrase: String?): AuthPublicKey(source)

Extract the AuthPublicKey from a private key for use with AuthHandler.onPublicKeysNeeded.

Return

The corresponding public key for probing

Parameters

algorithmName

SSH algorithm name (e.g., "ssh-ed25519", "rsa-sha2-256")

privateKeyData

PEM or OpenSSH private key contents as bytes

passphrase

Key passphrase, or null if unencrypted