Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sshtools.j2ssh.transport.publickey
Class SshPrivateKeyFile

    java.lang.Object
      com.sshtools.j2ssh.transport.publickey.SshPrivateKeyFile

public class SshPrivateKeyFile
extends java.lang.Object

DOCUMENT ME!

Constructor Summary
`protected` | `SshPrivateKeyFile(byte[] keyblob, SshPrivateKeyFormat format)` Creates a new SshPrivateKeyFile object.

Method Summary
`void` | `changePassphrase(java.lang.String oldPassphrase, java.lang.String newPassphrase)` DOCUMENT ME!
`static SshPrivateKeyFile` | `create(SshPrivateKey key, java.lang.String passphrase, SshPrivateKeyFormat format)`
`byte[]` | `getBytes()` DOCUMENT ME!
`SshPrivateKeyFormat` | `getFormat()` DOCUMENT ME!
`byte[]` | `getKeyBlob(java.lang.String passphrase)` DOCUMENT ME!
`boolean` | `isPassphraseProtected()` DOCUMENT ME!
`static SshPrivateKeyFile` | `parse(byte[] formattedKey)` DOCUMENT ME!
`static SshPrivateKeyFile` | `parse(java.io.File keyfile)` DOCUMENT ME!
`void` | `setFormat(SshPrivateKeyFormat newFormat, java.lang.String passphrase)` DOCUMENT ME!
`SshPrivateKey` | `toPrivateKey(java.lang.String passphrase)` DOCUMENT ME!
`java.lang.String` | `toString()` DOCUMENT ME!

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

Constructor Detail

### SshPrivateKeyFile

    protected SshPrivateKeyFile(byte[] keyblob,
                                SshPrivateKeyFormat format)

  Creates a new SshPrivateKeyFile object.

Parameters:
  `keyblob` - DOCUMENT ME!
  `format` - DOCUMENT ME!

Method Detail

### getBytes

    public byte[] getBytes()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### getKeyBlob

    public byte[] getKeyBlob(java.lang.String passphrase)
                      throws InvalidSshKeyException

  DOCUMENT ME!

  Parameters:
    `passphrase` - DOCUMENT ME!
  Returns:
    DOCUMENT ME!
  Throws:
    `InvalidSshKeyException` - DOCUMENT ME!

### changePassphrase

    public void changePassphrase(java.lang.String oldPassphrase,
                                 java.lang.String newPassphrase)
                          throws InvalidSshKeyException

  DOCUMENT ME!

  Parameters:
    `oldPassphrase` - DOCUMENT ME!
    `newPassphrase` - DOCUMENT ME!
  Throws:
    `InvalidSshKeyException` - DOCUMENT ME!

### parse

    public static SshPrivateKeyFile parse(byte[] formattedKey)
                                   throws InvalidSshKeyException

  DOCUMENT ME!

  Parameters:
    `formattedKey` - DOCUMENT ME!
  Returns:
    DOCUMENT ME!
  Throws:
    `InvalidSshKeyException` - DOCUMENT ME!

### parse

    public static SshPrivateKeyFile parse(java.io.File keyfile)
                                   throws InvalidSshKeyException,
                                          java.io.IOException

  DOCUMENT ME!

  Parameters:
    `keyfile` - DOCUMENT ME!
  Returns:
    DOCUMENT ME!
  Throws:
    `InvalidSshKeyException` - DOCUMENT ME!
    `java.io.IOException` - DOCUMENT ME!

### isPassphraseProtected

    public boolean isPassphraseProtected()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### create

    public static SshPrivateKeyFile create(SshPrivateKey key,
                                           java.lang.String passphrase,
                                           SshPrivateKeyFormat format)
                                    throws InvalidSshKeyException

  Throws:
    `InvalidSshKeyException`

### setFormat

    public void setFormat(SshPrivateKeyFormat newFormat,
                          java.lang.String passphrase)
                   throws InvalidSshKeyException

  DOCUMENT ME!

  Parameters:
    `newFormat` - DOCUMENT ME!
    `passphrase` - DOCUMENT ME!
  Throws:
    `InvalidSshKeyException` - DOCUMENT ME!

### getFormat

    public SshPrivateKeyFormat getFormat()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

### toPrivateKey

    public SshPrivateKey toPrivateKey(java.lang.String passphrase)
                               throws InvalidSshKeyException

  DOCUMENT ME!

  Parameters:
    `passphrase` - DOCUMENT ME!
  Returns:
    DOCUMENT ME!
  Throws:
    `InvalidSshKeyException` - DOCUMENT ME!

### toString

    public java.lang.String toString()

  DOCUMENT ME!

  Returns:
    DOCUMENT ME!

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD