Name

global.SSHPrivateKeyCredentialUtils

Description

No description available

Script

var SSHPrivateKeyCredentialUtils = Class.create();

SSHPrivateKeyCredentialUtils.keyIsInCorrectFormat = function(key) {
  // Every valid ssh_private_key starts with '-----BEGIN' header
  if (!key.nil() && key.indexOf('-----BEGIN') != 0) 
  	return false;
  	
  return true;
};

SSHPrivateKeyCredentialUtils.encryptUsingKMFCryptoOperation = function(key) {
  var op = new sn_kmf_ns.KMFCryptoOperation('global.com_snc_core_automation_connection_credential_glideencrypter','SYMMETRIC_WRAPPING').withAlgorithm('AES').withInputFormat('KMFNone');
  return op.doOperation(String(key));
};

SSHPrivateKeyCredentialUtils.decrypt = function(key){
  var encrypter = new GlideEncrypter();
  return encrypter.decrypt(key);
};

SSHPrivateKeyCredentialUtils.prototype = {
  initialize: function() {
  	
  },
  type: 'SSHPrivateKeyCredentialUtils',
};

Sys ID

81fd2be1c7133010bb93c49af4c26071

Offical Documentation

Official Docs: