Class IdentityInfo

    • Constructor Summary

      Constructors 
      Constructor Description
      IdentityInfo​(java.io.File privateKey)
      Constructs an identity info with private key.
      IdentityInfo​(java.io.File privateKey, byte[] passphrase)
      Constructs an identity info with private key and its passphrase.
      IdentityInfo​(java.io.File privateKey, java.io.File publicKey, byte[] passphrase)
      Constructs an identity info with private and public key and passphrase for the private key.
    • Constructor Detail

      • IdentityInfo

        public IdentityInfo​(java.io.File privateKey)
        Constructs an identity info with private key.

        The key is not passphrase protected.

        We use java.io.File because JSch cannot deal with VFS FileObjects.

        Parameters:
        privateKey - The file with the private key
        Since:
        2.1
      • IdentityInfo

        public IdentityInfo​(java.io.File privateKey,
                            byte[] passphrase)
        Constructs an identity info with private key and its passphrase.

        We use java.io.File because JSch cannot deal with VFS FileObjects.

        Parameters:
        privateKey - The file with the private key
        passphrase - The passphrase to decrypt the private key (can be null if no passphrase is used)
        Since:
        2.1
      • IdentityInfo

        public IdentityInfo​(java.io.File privateKey,
                            java.io.File publicKey,
                            byte[] passphrase)
        Constructs an identity info with private and public key and passphrase for the private key.

        We use java.io.File because JSch cannot deal with VFS FileObjects.

        Parameters:
        privateKey - The file with the private key
        publicKey - The public key part used for connections with exchange of certificates (can be null)
        passphrase - The passphrase to decrypt the private key (can be null if no passphrase is used)
        Since:
        2.1
    • Method Detail

      • addIdentity

        public void addIdentity​(com.jcraft.jsch.JSch jsch)
                         throws com.jcraft.jsch.JSchException
        Description copied from interface: IdentityProvider
        Add this identity to the given JSch.
        Specified by:
        addIdentity in interface IdentityProvider
        Parameters:
        jsch - Target JSch.
        Throws:
        com.jcraft.jsch.JSchException - If I/O error occurs.
        Since:
        2.4
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • getPassphrase

        public byte[] getPassphrase()
        Gets the passphrase of the private key.
        Returns:
        the passphrase
        Since:
        2.10.0
      • getPassPhrase

        @Deprecated
        public byte[] getPassPhrase()
        Deprecated.
        Gets the passphrase of the private key.
        Returns:
        the passphrase
        Since:
        2.1
      • getPrivateKey

        public java.io.File getPrivateKey()
        Gets the file with the private key.
        Returns:
        the file
        Since:
        2.1
      • getPublicKey

        public java.io.File getPublicKey()
        Gets the file with the public key.
        Returns:
        the file
        Since:
        2.1
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object