Class BytesIdentityInfo

java.lang.Object
org.apache.commons.vfs2.provider.sftp.BytesIdentityInfo
All Implemented Interfaces:
IdentityProvider

public class BytesIdentityInfo extends Object implements IdentityProvider
Structure for an identity based on byte arrays.
Since:
2.4
  • Field Details

    • passPhrase

      private final byte[] passPhrase
    • privateKey

      private final byte[] privateKey
    • publicKey

      private final byte[] publicKey
  • Constructor Details

    • BytesIdentityInfo

      public BytesIdentityInfo(byte[] privateKey, byte[] passPhrase)
      Constructs an identity info with private and passphrase for the private key.
      Parameters:
      privateKey - Private key bytes
      passPhrase - The passphrase to decrypt the private key (can be null if no passphrase is used)
    • BytesIdentityInfo

      public BytesIdentityInfo(byte[] privateKey, byte[] publicKey, byte[] passPhrase)
      Constructs an identity info with private and public key and passphrase for the private key.
      Parameters:
      privateKey - Private key bytes
      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)
  • Method Details

    • 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
    • getPassPhrase

      public byte[] getPassPhrase()
    • getPrivateKeyBytes

      public byte[] getPrivateKeyBytes()
    • getPublicKeyBytes

      public byte[] getPublicKeyBytes()