I need to configure an SSO using digital certificate between the client portal and a third party.To configure the SSO I have received the public key of the third party and able to access it from server location.Now I have to access priavte key of the client to sign it.I have created an abstract portal component and written the below code to fetch the Priavte key from my project folder.I have the certificate in project folder,after acessing the file from project it gives the below error.
String fielPath1 = request.getPublicResourcePath()+"/SAPLogonTicketKeypair-cert1.cer";
FileInputStream ksfis = new FileInputStream(fielPath1);
KeyStore ks = KeyStore.getInstance("JKS");
ks.load(null, sPass.toCharArray());
response.write(" Private key store type"+ ks);
response.write(" ksfis "+ ksfis);
BufferedInputStream ksbufin = new BufferedInputStream(ksfis);
response.write(" ksbufin"+ ksbufin);
ks.load(ksbufin, sPass.toCharArray());
PrivateKey priv = (PrivateKey) ks.getKey(alias, kPass.toCharArray());
response.write(" Private key access"+ priv);
I get the below error:
Error Invalid keystore formatsun.security.provider.JavaKeyStore.engineLoa d(JavaKeyStore.java:633)sun.security.provider.Java KeyStore$JKS.engineLoad(JavaKeyStore.java:38)java. security.KeyStore.load(KeyStore.java:1185)am_sso_a pc.doContent(am_sso_apc.java:132)com.sapportals.po rtal.prt.component.AbstractPortalComponent.service Deprecated(AbstractPortalComponent.java:213)
Please let me know how to pass the filepath to extract the priavte key from the server itself.
Thanks
Nisha