exportSshPublicKey
exportSshPublicKey
Export a public key as an OpenSSH public-key line.
Writes <type> <base64> [comment] with padded base64 and no trailing line break, the form ssh-keygen puts in .pub files. ECDSA points are written uncompressed. The key must be an extractable RSA, ECDSA (P-256, P-384, P-521) or Ed25519 public CryptoKey.
ts
function exportSshPublicKey(
publicKey: CryptoKey,
options: SshExportOptions,
): Promise<string>Parameters
publicKey:CryptoKeyoptions:SshExportOptions
Throws
ResultError— Carrying anSshExportErrorCodeascode
See also
importSshPublicKeyfor the inverse operation