# KeyProviderUtil (sshj 0.5.0 API)
Date: 2011-07-27

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

    java.lang.Object
      net.schmizz.sshj.userauth.keyprovider.KeyProviderUtil

    public class KeyProviderUtil

extends Object

Constructor Summary
`KeyProviderUtil()`

Method Summary
`static FileKeyProvider.Format` `detectKeyFileFormat(File location)` Attempts to detect how a key file is encoded.
`static FileKeyProvider.Format` `detectKeyFileFormat(String privateKey, boolean separatePubKey)` Attempts to detect how a key file is encoded.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### KeyProviderUtil

    public KeyProviderUtil()

Method Detail

### detectKeyFileFormat

    public static FileKeyProvider.Format detectKeyFileFormat(File location)
                                                      throws IOException

  Attempts to detect how a key file is encoded.

  Return values are consistent with the `NamedFactory` implementations in the `keyprovider` package.

  Parameters:
    `location` -
  Returns:
    name of the key file format
  Throws:
    `IOException`

### detectKeyFileFormat

    public static FileKeyProvider.Format detectKeyFileFormat(String privateKey,
                                                             boolean separatePubKey)
                                                      throws IOException

  Attempts to detect how a key file is encoded.

  Return values are consistent with the `NamedFactory` implementations in the `keyprovider` package.

  Parameters:
    `privateKey` - Private key stored in a string
    `separatePubKey` - Is the public key stored separately from the private key
  Returns:
    name of the key file format
  Throws:
    `IOException`

Copyright © 2009-2011. All Rights Reserved.