Hello,
We have developed a java adapter module in order to digitally sign a PDF with SAP PI.
To do this, we have a certificate uploaded in the Key Store.
The problem is, when we run the process and the module is executed, we get this log:
ID21109: Remote call failed
Reading about this error, we know this log is about this exception:
[EXCEPTION]{1}#2#ticket#java.security.NoSuchAlgorithmException: ID21109: Remote call errored at com.sap.engine.services.keystore.spi.EBSDKSKeyStoreSpiImpl.engineGetKey(EBSDKSKeyStoreSpiImpl.java:162 at java.security.KeyStore.getKey(KeyStore.java:320)
In the JAVA code the error comes after the line in blue:
try {
SAPSecurityResources secRes = SAPSecurityResources.getInstance();
KeyStoreManager ksm = secRes.getKeyStoreManager(PermissionMode.SYSTEM_LEVEL);
ks = ksm.getKeyStore(keyStoreView);
if (ks == null) {
addError("No se ha encontrado la KeyStore View:" + keyStoreView);
}
else{
addInfo("Se ha encontrado la KeyStore View:" + keyStoreView);
certificate = ks.getCertificate(alias);
try {
privateKey = (PrivateKey) ks.getKey(alias, publicKey);
addInfo("Private key " + privateKey.toString());
if(certificate == null){
addError("No se ha encontrado el certificado:" + alias);
}
else{
addInfo("Se ha encontrado el certificado:" + alias);
}
if (privateKey != null){
addInfo("Se ha encontrado la clave privada");
addInfo("Algoritmo:" + privateKey.getAlgorithm());
addInfo("Provider:" + ks.getProvider().getName());
ExternalSignature pks = new PrivateKeySignature(privateKey, DigestAlgorithms.SHA256, ks.getProvider().getName());
addInfo("Hash algorithm:" + pks.getHashAlgorithm() );
}
} catch (NoSuchAlgorithmException e) {
/*addError("No se ha encontrado el algoritmo");*/
addError(e.getLocalizedMessage() + e.getCause().getLocalizedMessage());
} catch (UnrecoverableKeyException e) {
addError("Error obteniendo la clave privada");
}
}
What could be the problem? Do you know if there is any possibility to install an algorithm in the PI machine?
If we run this adapter module in another SAP PI it works... So, any idea?
Thanks in advance.
Lara.