Class IdentityInfo

  • All Implemented Interfaces:
    IdentityProvider

    public class IdentityInfo
    extends java.lang.Object
    implements IdentityProvider
    Structure for an identity based on Files.
    Since:
    2.1
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private byte[] passPhrase  
      private java.io.File privateKey  
      private java.io.File publicKey  
    • 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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addIdentity​(com.jcraft.jsch.JSch jsch)  
      private java.lang.String getAbsolutePath​(java.io.File file)  
      byte[] getPassPhrase()
      Get the passphrase of the private key.
      java.io.File getPrivateKey()
      Get the file with the private key.
      java.io.File getPublicKey()
      Get the file with the public key.
      • Methods inherited from class java.lang.Object

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

      • passPhrase

        private final byte[] passPhrase
      • privateKey

        private final java.io.File privateKey
      • publicKey

        private final java.io.File publicKey
    • 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
        Specified by:
        addIdentity in interface IdentityProvider
        Throws:
        com.jcraft.jsch.JSchException
        Since:
        2.4
      • getAbsolutePath

        private java.lang.String getAbsolutePath​(java.io.File file)
      • getPassPhrase

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

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

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