Class 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 Detail

      • 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)
      • isPrivateKey

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

        public com.amazonaws.services.ec2.model.KeyPair find​(com.amazonaws.services.ec2.AmazonEC2 ec2)
                                                      throws IOException,
                                                             com.amazonaws.AmazonClientException
        Finds the KeyPairInfo that corresponds to this key in EC2.
        Throws:
        IOException
        com.amazonaws.AmazonClientException
      • decryptWindowsPassword

        public String decryptWindowsPassword​(String encodedPassword)
                                      throws com.amazonaws.AmazonClientException
        Throws:
        com.amazonaws.AmazonClientException
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object