Hi Alan,

Similarly, is the same possible when using a policy based
> configuration, that is instead of specifying <ramp:RampartConfig>
> elements in xml, is it possible to specify these program code?


Yes. This is  possible.

      StAXOMBuilder builder = new StAXOMBuilder(xmlPath);
      Policy policy = PolicyEngine.getPolicy(builder.getDocumentElement());

      RampartConfig rampartConfig = new RampartConfig();
      rampartConfig.setUser("Alan");
      rampartConfig.setEncryptionUser("Someone");
      ...
      rampartConfig.setSigCryptoConfig(sigCryptoConfig);
      rampartConfig.setEncrCryptoConfig(encrCrypto);

      policy.addAssertion(rampartConfig);


Regards,
Nandana

Reply via email to