Class KeyPair

java.lang.Object
com.jcraft.jsch.KeyPair
Direct Known Subclasses:
KeyPairDSA, KeyPairECDSA, KeyPairPKCS8, KeyPairRSA

public abstract class KeyPair
extends java.lang.Object
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected byte[] data  
    static int DSA  
    static int ECDSA  
    protected boolean encrypted  
    static int ERROR  
    protected java.lang.String publicKeyComment  
    static int RSA  
    static int UNKNOWN  
  • Constructor Summary

    Constructors 
    Constructor Description
    KeyPair​(JSch jsch)  
  • Method Summary

    Modifier and Type Method Description
    boolean decrypt​(byte[] _passphrase)  
    boolean decrypt​(java.lang.String _passphrase)  
    void dispose()  
    void finalize()  
    abstract byte[] forSSHAgent()  
    static KeyPair genKeyPair​(JSch jsch, int type)  
    static KeyPair genKeyPair​(JSch jsch, int type, int key_size)  
    java.lang.String getFingerPrint()
    Returns the finger-print of the public key.
    abstract int getKeyType()  
    byte[] getPublicKeyBlob()
    Returns the blob of the public key.
    java.lang.String getPublicKeyComment()  
    abstract byte[] getSignature​(byte[] data)  
    abstract byte[] getSignature​(byte[] data, java.lang.String alg)  
    abstract Signature getVerifier()  
    abstract Signature getVerifier​(java.lang.String alg)  
    boolean isEncrypted()  
    static KeyPair load​(JSch jsch, byte[] prvkey, byte[] pubkey)  
    static KeyPair load​(JSch jsch, java.lang.String prvkey)  
    static KeyPair load​(JSch jsch, java.lang.String prvfile, java.lang.String pubfile)  
    void setPassphrase​(byte[] passphrase)
    Deprecated.
    use #writePrivateKey(String name, byte[] passphrase)
    void setPassphrase​(java.lang.String passphrase)
    Deprecated.
    use #writePrivateKey(java.io.OutputStream out, byte[] passphrase)
    void setPublicKeyComment​(java.lang.String publicKeyComment)  
    void writePrivateKey​(java.io.OutputStream out)
    Writes the plain private key to the given output stream.
    void writePrivateKey​(java.io.OutputStream out, byte[] passphrase)
    Writes the cyphered private key to the given output stream.
    void writePrivateKey​(java.lang.String name)
    Writes the plain private key to the file.
    void writePrivateKey​(java.lang.String name, byte[] passphrase)
    Writes the cyphered private key to the file.
    void writePublicKey​(java.io.OutputStream out, java.lang.String comment)
    Writes the public key with the specified comment to the output stream.
    void writePublicKey​(java.lang.String name, java.lang.String comment)
    Writes the public key with the specified comment to the file.
    void writeSECSHPublicKey​(java.io.OutputStream out, java.lang.String comment)
    Writes the public key with the specified comment to the output stream in the format defined in http://www.ietf.org/rfc/rfc4716.txt
    void writeSECSHPublicKey​(java.lang.String name, java.lang.String comment)
    Writes the public key with the specified comment to the output stream in the format defined in http://www.ietf.org/rfc/rfc4716.txt

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait