Function: Key Pair Generate for SSH

by Simon Sparks · 1 October 2025

To use this function add it to the class library file named PluginSSHService.ts

GitHub Repository: https://github.com/SimonSparksUK/Orchestrator

Filename: PluginSSHService.ts

Description: Orchestrator Function to generate a Key Pair for SSH

Function generateKeyPair

public generateKeyPair(strPassword:string, intKeyLength:number = 2048) : void {
  try
  {
  	let strFingerPrint:string = KeyPairManager.generateKeyPair("dsa", "../server/vmo/conf/vco_key_for_ssh", strPassword, intKeyLength, "");
  
  	this.objLogger.info(strFingerPrint);
  }
  catch (objException)
  {
  	this.objLogger.info("Failed to generate key pair" + objException);
  }
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like