I found some examples generating RSA Key Pais with the java KeyPairGenerator. But what I am searching for is a way to use a existing RSA key pair to encrypt/decrypt messages. For example I can generate SSH2 key pairs within eclipse which I can use for different things (e.g. sign maven artefacts, access git....)
But I found no java example how to load my private (password secured) RSA key and encrypt/decrypt a message.
How can I do this? Can anybody give me a simple example.
This is an example of a public key:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCYUsJ8cqtZD+/hJRl5Pq6k7139hjpNKdrHzB/vndcFq1aLS3da2iS0BZu17FS+RwVIj29aFwmdqh0OSck648yZC5O79Uf2k/tT6Nx1z7P7KCWJTQ9zrd9t++Ox6RWzkIgj4q5oq8P/S6p/3f1NeG2SZoPrWpRojQsWl8LPqdVTvQ== RSA-1024