Extend get credentials functions for working with keys

Change-Id: I5aec7605fe2f8dc7bed5847685f899efaf75bb1b
diff --git a/src/com/mirantis/mk/Common.groovy b/src/com/mirantis/mk/Common.groovy
index ffa72d3..8c0b56e 100644
--- a/src/com/mirantis/mk/Common.groovy
+++ b/src/com/mirantis/mk/Common.groovy
@@ -32,9 +32,15 @@
  *
  * @param id    Credentials name
  */
-def getCredentials(id) {
+def getCredentials(id, cred_type = "username_password") {
+    def credClass;
+    if(cred_type == "username_password"){
+        credClass = com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials.class
+    }else if(cred_type == "key"){
+        credClass = com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey.class
+    }
     def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials(
-                    com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials.class,
+                    credClass,
                     jenkins.model.Jenkins.instance
                 )