Key generation
SSHKeyGenerationType
public enum SSHKeyGenerationType: Sendable, Equatable {
case ed25519
case rsa(bits: Int = 3072)
case ecdsaP256
case ecdsaP384
case ecdsaP521
}
SSHGeneratedKeyPair
public struct SSHGeneratedKeyPair: Equatable, Sendable {
public var privateKeyOpenSSH: String
public var authorizedKey: String
public var publicKeyType: String
public init(privateKeyOpenSSH: String, authorizedKey: String, publicKeyType: String)
}
SSHKeyGenerator
public enum SSHKeyGenerator {
public static func generateOpenSSHKeyPair(
type: SSHKeyGenerationType = .ed25519,
comment: String? = nil,
passphrase: String? = nil
) throws -> SSHGeneratedKeyPair
}
Synchronous throwing API; no async or callback variant. Errors bridge from the underlying Obj-C SSHKitGeneratedKeyPair error.