Apache Commons and JSch both require a private key file to set up an SFTP connection. The project I'm working on will be used to connect to multiple SFTP servers. Therefore, we do not hope to deploy multiple private key files, but rather keep these keys as strings in an encrypted config file. Is there an SFTP library that doesn't require a file object for private key?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
The JSch has an
addIdentity
method overload that takes the key from a buffer:Alternatives:
There is also an
addIdentity
overload that takes anIdentity
interface:Just implement the interface to get the private key from wherever you need.
See
IdentityFile
for an example implementation.Alternatively, store all your keys to
IdentityRepository
.