Interface Identity


public interface Identity
  • Method Summary

    Modifier and Type Method Description
    void clear()
    Disposes internally allocated data, like byte array for the private key.
    boolean decrypt()
    Deprecated.
    The decryption should be done automatically in #setPassphase(byte[] passphrase)
    java.lang.String getAlgName()
    Returns the name of the key algorithm.
    java.lang.String getName()
    Returns the name of this identity.
    byte[] getPublicKeyBlob()
    Returns the public-key blob.
    byte[] getSignature​(byte[] data)
    Signs on data with this identity, and returns the result.
    byte[] getSignature​(byte[] data, java.lang.String alg)
    Signs on data with this identity, and returns the result.
    boolean isEncrypted()
    Returns true if this identity is cyphered.
    boolean setPassphrase​(byte[] passphrase)
    Decrypts this identity with the specified pass-phrase.
  • Method Details

    • setPassphrase

      boolean setPassphrase​(byte[] passphrase) throws JSchException
      Decrypts this identity with the specified pass-phrase.
      Parameters:
      passphrase - the pass-phrase for this identity.
      Returns:
      true if the decryption is succeeded or this identity is not cyphered.
      Throws:
      JSchException
    • getPublicKeyBlob

      byte[] getPublicKeyBlob()
      Returns the public-key blob.
      Returns:
      the public-key blob
    • getSignature

      byte[] getSignature​(byte[] data)
      Signs on data with this identity, and returns the result.
      Parameters:
      data - data to be signed
      Returns:
      the signature
    • getSignature

      byte[] getSignature​(byte[] data, java.lang.String alg)
      Signs on data with this identity, and returns the result.
      Parameters:
      data - data to be signed
      alg - signature algorithm to use
      Returns:
      the signature
    • decrypt

      @Deprecated boolean decrypt()
      Deprecated.
      The decryption should be done automatically in #setPassphase(byte[] passphrase)
      See Also:
      setPassphrase(byte[] passphrase)
    • getAlgName

      java.lang.String getAlgName()
      Returns the name of the key algorithm.
      Returns:
      "ssh-rsa" or "ssh-dss"
    • getName

      java.lang.String getName()
      Returns the name of this identity. It will be useful to identify this object in the IdentityRepository.
    • isEncrypted

      boolean isEncrypted()
      Returns true if this identity is cyphered.
      Returns:
      true if this identity is cyphered.
    • clear

      void clear()
      Disposes internally allocated data, like byte array for the private key.