encodePublicKey

Encode a KeyPair's public key to an AuthPublicKey for use with AuthHandler.onPublicKeysNeeded.

The SSH algorithm name is inferred from the key type (e.g., Ed25519 → "ssh-ed25519", RSA → "ssh-rsa"). For RSA keys that need a specific signature algorithm like "rsa-sha2-256", construct the AuthPublicKey with the desired algorithm name using the returned blob.

ML-DSA keys and complete ML-DSA-44/Ed25519 composite keys are supported when supplied by a capable platform provider. See SshKeys for private-key import/export.

Return

The corresponding AuthPublicKey

Parameters

keyPair

JCA key pair