Package com.sshtools.j2ssh.openssh
Class OpenSSHPrivateKeyFormat
- java.lang.Object
-
- com.sshtools.j2ssh.openssh.OpenSSHPrivateKeyFormat
-
- All Implemented Interfaces:
SshPrivateKeyFormat
public class OpenSSHPrivateKeyFormat extends java.lang.Object implements SshPrivateKeyFormat
- Version:
- $Revision: 1.12 $
- Author:
- $author$
-
-
Constructor Summary
Constructors Constructor Description OpenSSHPrivateKeyFormat()
Creates a new OpenSSHPrivateKeyFormat object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
decryptKeyblob(byte[] formattedKey, java.lang.String passphrase)
byte[]
encryptKeyblob(byte[] keyblob, java.lang.String passphrase)
java.lang.String
getFormatType()
boolean
isFormatted(byte[] formattedKey)
boolean
isPassphraseProtected(byte[] formattedKey)
boolean
supportsAlgorithm(java.lang.String algorithm)
java.lang.String
toString()
-
-
-
Method Detail
-
getFormatType
public java.lang.String getFormatType()
- Specified by:
getFormatType
in interfaceSshPrivateKeyFormat
- Returns:
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- Returns:
-
decryptKeyblob
public byte[] decryptKeyblob(byte[] formattedKey, java.lang.String passphrase) throws InvalidSshKeyException
- Specified by:
decryptKeyblob
in interfaceSshPrivateKeyFormat
- Parameters:
formattedKey
-passphrase
-- Returns:
- Throws:
InvalidSshKeyException
-
encryptKeyblob
public byte[] encryptKeyblob(byte[] keyblob, java.lang.String passphrase) throws InvalidSshKeyException
- Specified by:
encryptKeyblob
in interfaceSshPrivateKeyFormat
- Parameters:
keyblob
-passphrase
-- Returns:
- Throws:
InvalidSshKeyException
-
isFormatted
public boolean isFormatted(byte[] formattedKey)
- Specified by:
isFormatted
in interfaceSshPrivateKeyFormat
- Parameters:
formattedKey
-- Returns:
-
isPassphraseProtected
public boolean isPassphraseProtected(byte[] formattedKey)
- Specified by:
isPassphraseProtected
in interfaceSshPrivateKeyFormat
- Parameters:
formattedKey
-- Returns:
-
supportsAlgorithm
public boolean supportsAlgorithm(java.lang.String algorithm)
- Specified by:
supportsAlgorithm
in interfaceSshPrivateKeyFormat
- Parameters:
algorithm
-- Returns:
-
-