Using Java DSL, I have a route in which I poll a file in an SFTP server using the file name set in the message headers
from(\"direct:download\") .pollEnr
You can reference privateKey as bean from registry.
privateKey
.pollEnrich() .simple("sftp://my.host:22/folder/?username=foo&privateKey=#myKeyInRegistry&fileName=${header.CamelFileName}")
Binding bean to registry depends on platform and Camel version you are using.