Package ghidra.framework.remote.security
Class SSHKeyManager
java.lang.Object
ghidra.framework.remote.security.SSHKeyManager
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.bouncycastle.crypto.CipherParameters
getSSHPrivateKey
(File sshPrivateKeyFile) Return the SSH private key corresponding to the specified key file.static org.bouncycastle.crypto.CipherParameters
getSSHPrivateKey
(InputStream sshPrivateKeyIn) Return the SSH private key corresponding to the specified key input stream.static org.bouncycastle.crypto.CipherParameters
getSSHPublicKey
(File sshPublicKeyFile) Attempt to instantiate an SSH public key from the specified file which contains a single public key.static void
Set PKI protected keystore password provider
-
Method Details
-
setProtectedKeyStorePasswordProvider
Set PKI protected keystore password provider- Parameters:
provider
- key store password provider
-
getSSHPrivateKey
public static org.bouncycastle.crypto.CipherParameters getSSHPrivateKey(File sshPrivateKeyFile) throws InvalidKeyException, IOException Return the SSH private key corresponding to the specified key file. If the specified key file is encrypted the currently installed password provider will be used to obtain the decrypt password.- Parameters:
sshPrivateKeyFile
- private ssh key file- Returns:
- private key cipher parameters (
RSAKeyParameters
orDSAKeyParameters
) - Throws:
FileNotFoundException
- key file not foundIOException
- if key file not found or key parse failedInvalidKeyException
- if key is not an SSH private key (i.e., PEM format)
-
getSSHPrivateKey
public static org.bouncycastle.crypto.CipherParameters getSSHPrivateKey(InputStream sshPrivateKeyIn) throws InvalidKeyException, IOException Return the SSH private key corresponding to the specified key input stream. If the specified key is encrypted the currently installed password provider will be used to obtain the decrypt password.- Parameters:
sshPrivateKeyIn
- private ssh key resource input stream- Returns:
- private key cipher parameters (
RSAKeyParameters
orDSAKeyParameters
) - Throws:
FileNotFoundException
- key file not foundIOException
- if key file not found or key parse failedInvalidKeyException
- if key is not an SSH private key (i.e., PEM format)
-
getSSHPublicKey
public static org.bouncycastle.crypto.CipherParameters getSSHPublicKey(File sshPublicKeyFile) throws IOException Attempt to instantiate an SSH public key from the specified file which contains a single public key.- Parameters:
sshPublicKeyFile
- public ssh key file- Returns:
- public key cipher parameters
RSAKeyParameters
orDSAKeyParameters
- Throws:
FileNotFoundException
- key file not foundIOException
- if key file not found or key parse failed
-