Hi Richard,
The private key .pem file is there in local system which is working as a workstation to contact with the server. We are using Chef, a cloud infrastructure automation framework to interact with the cloud VMs.
The private key is used to get authenticate with the Chef server with the servers own public key. A public-private ket set will generate while configuring the local git repository to authenticate,
but I'm not sure how the encryption is done. Here is the link for the opscode.com -
http://docs.opscode.com/auth.html
We are using Apache Jclouds API to connect with private cloud via Chef. Here is the link for the topic -
http://jclouds.apache.org/documentation/gettingstarted/what-is-jclouds/
I need to call the below method to get the authentication signature from Chef API. Here I have to pass the privateKey as a RSAPrivateKey which has been generated from the .pem file.
public
String sign(String toSign) {
try {
byte[] encrypted = toByteArray(new RSAEncryptingPayload(Payloads.newStringPayload(toSign), privateKey));
return base64().encode(encrypted);
} catch (IOException e) {
throw new HttpException("error signing request", e);
}
}