Class SSHKeyManager


  • public class SSHKeyManager
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object getSSHPrivateKey​(java.io.File sshPrivateKeyFile)
      Return the SSH private key corresponding to the specified key file.
      static java.lang.Object getSSHPrivateKey​(java.io.InputStream sshPrivateKeyIn)
      Return the SSH private key corresponding to the specified key input stream.
      static java.lang.Object getSSHPublicKey​(java.io.File sshPublicKeyFile)
      Attempt to instantiate an SSH public key from the specified file which contains a single public key.
      static void setProtectedKeyStorePasswordProvider​(KeyStorePasswordProvider provider)
      Set PKI protected keystore password provider
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setProtectedKeyStorePasswordProvider

        public static void setProtectedKeyStorePasswordProvider​(KeyStorePasswordProvider provider)
        Set PKI protected keystore password provider
        Parameters:
        provider -
      • getSSHPrivateKey

        public static java.lang.Object getSSHPrivateKey​(java.io.File sshPrivateKeyFile)
                                                 throws java.io.IOException
        Return the SSH private key corresponding to the specified key file. If the specified key file is encrypted the currently installed password provider will be used to obtain the decrypt password.
        Parameters:
        sshPrivateKeyFile -
        Returns:
        RSAPrivateKey or DSAPrivateKey
        Throws:
        java.io.FileNotFoundException - key file not found
        java.io.IOException - if key file not found or key parse failed
        See Also:
        RSAPrivateKey, DSAPrivateKey
      • getSSHPrivateKey

        public static java.lang.Object getSSHPrivateKey​(java.io.InputStream sshPrivateKeyIn)
                                                 throws java.io.IOException
        Return the SSH private key corresponding to the specified key input stream. If the specified key is encrypted the currently installed password provider will be used to obtain the decrypt password.
        Parameters:
        sshPrivateKeyIn -
        Returns:
        RSAPrivateKey or DSAPrivateKey
        Throws:
        java.io.FileNotFoundException - key file not found
        java.io.IOException - if key file not found or key parse failed
        See Also:
        RSAPrivateKey, DSAPrivateKey
      • getSSHPublicKey

        public static java.lang.Object getSSHPublicKey​(java.io.File sshPublicKeyFile)
                                                throws java.io.IOException
        Attempt to instantiate an SSH public key from the specified file which contains a single public key.
        Parameters:
        sshPublicKeyFile -
        Returns:
        RSAPublicKey or DSAPublicKey
        Throws:
        java.io.FileNotFoundException - key file not found
        java.io.IOException - if key file not found or key parse failed
        See Also:
        RSAPublicKey, DSAPublicKey