Hi,
I have implemented WSS4J based encryption and decryption as java program and used java callout to access them in Apigee. This approach is working as expected.
I would like to make the certificate reference in the java program configurable in vault (or somewhere external to the jar). This is required to make sure the certificate change doesn’t trigger a redeployment from operations management perspective.
Any help on this will be of a great help.
Here is the snapshot of the callout policy and java code snippet that is referencing the certificate key store.
JCall.WSSDecrypt.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<JavaCallout name="JCall.WSSDecrypt">
<ClassName>com.apigee.wss.WSSDecryptorCallout</ClassName>
<ResourceURL>java://InternalWSS.jar</ResourceURL>
</JavaCallout>
Java program to decrypt:
Properties props = new Properties();
props.setProperty("org.apache.wss4j.crypto.provider", "org.apache.wss4j.common.crypto.Merlin");
props.setProperty("org.apache.wss4j.crypto.merlin.keystore.type", "jks");
props.setProperty("org.apache.wss4j.crypto.merlin.keystore.password", keyStorePassword);
props.setProperty("org.apache.wss4j.crypto.merlin.keystore.alias", keyStoreAlias);
// reference to the keystore in jks format
props.setProperty("org.apache.wss4j.crypto.merlin.keystore.file", "resources/APIX_KeyStore.jks");
crypto = CryptoFactory.getInstance(props);
secEngine.setWssConfig(WSSConfig.getNewInstance());
......then the code to do decryption using the RequestData API
I am looking at pointers to pass the keystore file (.jks) as input to the java program from Apigee callout proxy so that i can make it configurable.
Open to any other suggestion to make it configurable to make sure the jar doesn’t change with the certificate change.