Class EC2PrivateKey

java.lang.Object
hudson.plugins.ec2.EC2PrivateKey

public class EC2PrivateKey extends Object
RSA private key (the one that you generate with ec2-add-keypair.)

Starts with "----- BEGIN RSA PRIVATE KEY------\n".

Author:
Kohsuke Kawaguchi
  • Method Details

    • getPrivateKey

      public String getPrivateKey()
    • getPrivateKeySecret

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public Secret getPrivateKeySecret()
    • getFingerprint

      public String getFingerprint() throws IOException
      Obtains the fingerprint of the key in the "ab:cd:ef:...:12" format.
      Throws:
      IOException - if the underlying private key is invalid: empty or password protected (password protected private keys are not yet supported)
    • getPublicFingerprint

      public String getPublicFingerprint() throws IOException
      Throws:
      IOException
    • isPrivateKey

      public boolean isPrivateKey() throws IOException
      Is this file really a private key?
      Throws:
      IOException
    • find

      public KeyPair find(software.amazon.awssdk.services.ec2.Ec2Client ec2) throws IOException, software.amazon.awssdk.core.exception.SdkException
      Finds the KeyPairInfo that corresponds to this key in EC2.
      Throws:
      IOException
      software.amazon.awssdk.core.exception.SdkException
    • decryptWindowsPassword

      public String decryptWindowsPassword(String encodedPassword) throws software.amazon.awssdk.core.exception.SdkException
      Throws:
      software.amazon.awssdk.core.exception.SdkException
    • fetchFromDisk

      @CheckForNull public static EC2PrivateKey fetchFromDisk()
    • fetchFromDisk

      @CheckForNull public static EC2PrivateKey fetchFromDisk(String filepath)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object that)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object