net.schmizz.sshj.userauth.keyprovider
Class OpenSSHKeyFile

java.lang.Object
  extended by net.schmizz.sshj.userauth.keyprovider.PKCS8KeyFile
      extended by net.schmizz.sshj.userauth.keyprovider.OpenSSHKeyFile
All Implemented Interfaces:
FileKeyProvider, KeyProvider

public class OpenSSHKeyFile
extends PKCS8KeyFile

Represents an OpenSSH identity that consists of a PKCS8-encoded private key file and an unencrypted public key file of the same name with the ".pub" extension. This allows to delay requesting of the passphrase until the private key is requested.

See Also:
PKCS8KeyFile

Nested Class Summary
static class OpenSSHKeyFile.Factory
           
 
Nested classes/interfaces inherited from interface net.schmizz.sshj.userauth.keyprovider.FileKeyProvider
FileKeyProvider.Format
 
Field Summary
 
Fields inherited from class net.schmizz.sshj.userauth.keyprovider.PKCS8KeyFile
kp, log, passphrase, pwdf, resource, type
 
Constructor Summary
OpenSSHKeyFile()
           
 
Method Summary
 PublicKey getPublic()
           
 void init(File location)
           
 void init(String privateKey, String publicKey)
           
 
Methods inherited from class net.schmizz.sshj.userauth.keyprovider.PKCS8KeyFile
getPrivate, getType, init, init, makeBouncyPasswordFinder, readKeyPair, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OpenSSHKeyFile

public OpenSSHKeyFile()
Method Detail

getPublic

public PublicKey getPublic()
                    throws IOException
Specified by:
getPublic in interface KeyProvider
Overrides:
getPublic in class PKCS8KeyFile
Returns:
the public key.
Throws:
IOException - if there is an I/O error retrieving the public key

init

public void init(File location)
Specified by:
init in interface FileKeyProvider
Overrides:
init in class PKCS8KeyFile

init

public void init(String privateKey,
                 String publicKey)
Specified by:
init in interface FileKeyProvider
Overrides:
init in class PKCS8KeyFile


Copyright © 2009-2012. All Rights Reserved.