+ Start a Discussion

Using private key with Crypto.Sign



I am trying to sign an input within APEX. Can anyone help me with the correct way of signing an input with a private key? I have the certificate (.crt) file and provate key (jks) file. 


1. How can i get the pkcs8 format key, do I need to create a new certificate along with the new key?


2. Once i get the key, How can i use the pirvate key to sign an input string within APEX, do i put that in a String, what about the new line characters we get in the key file?