javasamlassertionopensaml

Where can I get a PEM (private) key?


I am working on IdP-initiated SAML response for Salesforce and need your help.

I was working with the code and found that I need a .pem (private) key.

KeyStore.PrivateKeyEntry pkEntry = (KeyStore.PrivateKeyEntry)   ks.getEntry("alias", new KeyStore.PasswordProtection(password));
PrivateKey pk = pkEntry.getPrivateKey();

The PEM key will be used to sign my response signature. Where can I get a .pem key?


Solution

  • openssl req -x509 -nodes -days 365 -newkey rsa:1024 -sha1 -subj ‘/C=US/ST=CA/L=San Mateo/CN=www.appirio.com’ -keyout key-mycompanyrsa.pem -out cert-mycompanyrsa.pem
    

    More info: http://blog.jeffdouglas.com/2010/07/06/using-rsa-sha1-with-salesforce-crypto-class/