# OpenSSHKeyFile (sshj 0.4.1 API)
Date: 2011-06-19

## net.schmizz.sshj.userauth.keyprovider
Class OpenSSHKeyFile

    java.lang.Object
      net.schmizz.sshj.userauth.keyprovider.PKCS8KeyFile
          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-2011. All Rights Reserved.