Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.84 KB | None | 0 0
  1. @Bean
  2.     public KeyStoreCallbackHandler callback() throws Exception{
  3.         KeyStoreCallbackHandler callbackHandler = new KeyStoreCallbackHandler();
  4.  
  5.        
  6.         callbackHandler.setPrivateKeyPassword("softnet_passwordo");
  7.         callbackHandler.setKeyStore(keyStoreFactoryBean());
  8.         callbackHandler.setTrustStore(keyStoreFactoryBean());
  9.  
  10.         return callbackHandler;
  11.     }
  12.  
  13. @Bean
  14.     public XwsSecurityInterceptor securityInterceptor() {
  15.         XwsSecurityInterceptor securityInterceptor = new XwsSecurityInterceptor();
  16.         securityInterceptor.setPolicyConfiguration(new ClassPathResource("securityPolicy.xml"));
  17.  
  18.         try{
  19.             securityInterceptor.setCallbackHandler(callback());
  20.  
  21.         }
  22.             catch (Exception e)  {
  23.                     System.out.println("display Expensionm: " + e);
  24.  
  25.  
  26.  
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement