webMethods Integration Server package for PGP

Hi,

I’m trying to implement the GitHub PGP package (GitHub - SoftwareAG/webmethods-integrationserver-pgpencryption: webMethods Integration Server PGP package), but getting errors while running the readPublicKeys and getPrivateKeys. Fixed readPublicKeys by modifying the below step by referring the pgp_idk.jar

GitHub Code : keyPub = PGPKeyReader.readPublicKey(ringPub,PGPInit.getKeyExchangeAlgorithm(alg));
Modified Code : keyPub = PGPKeyReader.readPublicKey(path,PGPInit.getKeyExchangeAlgorithm(alg));

Unable to fix the getPrivateKeys service, getting the error “Private key ring is empty” while running testDecryptFile service.

[I]getPrivateKeys is only returning “privateKeyRing” as per the GitHub code. I fixed this service to return all the output parameters by changing the code entirely(attached), still testDecryptFile is throwing the same error. Can someone help me with this?
modifiedgetPrivateKeys.java (3.22 KB)

Is your private key in a key file or keyring file?
It can’t be both, so these two lines:
ringSecret = PGPKeyReader.readSecretKeyRing(path);
keySecret = PGPKeyReader.readSecretKey(path);
only one should be called.

Hi Tong,

Thanks for your reply.

Actually the only requirement of this java service is to get the secretKeyRing. I modified the service only to get this, still the decryptandVerify service in throws the error “Private key ring is empty”.

Modified Service:
String path = IDataUtil.getString(pc, “path”);
IData data = IDataFactory.create();
PGPSecretKeyRingCollection secretKeyRing = null;
try {
IDataCursor dc = data.getCursor();
secretKeyRing = PGPKeyReader.readSecretKeyRing(path);
IDataUtil.put(dc, “privateKeyRing”, secretKeyRing);
dc.destroy();
} catch (Exception e) {
throw new RuntimeException("Unable to read private key file: " + e.getMessage());
}

	IDataUtil.put(pc, "privateKeyData", data);
	pc.destroy();

Also attached the output of this modified java service

Hi Vinod,

We are facing the same issue for both readPublicKeys and readPrivateKeys services.
We are getting the below error :
Service ‘pgp.services.keys.readPublicKeys’ is not operational.To run this service,first compile the Java source.

Please help us in resolving this issue.

Thanks in advance.

Madhu

Hi Madhu,

Make ensure if your java code is complied and deployed.

Right click and Edit the service [ just enter tab and delete it ]. java service need of compiling before deployed to target server . Edit and saving the service will compile for you.

Regards,
Dinesh

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.