function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MiddhaMiddha 

Using private key with Crypto.Sign

Hi,

 

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?