Symantec Developer Group

 View Only

system variable setting for keystore (VIP API)

  • 1.  system variable setting for keystore (VIP API)

    Posted Jul 05, 2015 11:53 PM

    Hi

     

    Example of "VIP_UserServices.pdf" mention, we need set system variable for keystore before calling the VIP API, e.g;

    public class VipUserServicesQueryClient {
     public static void main(String[] args) throws RemoteException {
      String pathToP12File = "D:/workspace/certs/clientcert.p12";
      String password = "password";
      System.setProperty("javax.net.ssl.keyStoreType", "pkcs12");
      System.setProperty("javax.net.ssl.keyStore", pathToP12File);
      System.setProperty("javax.net.ssl.keyStorePassword", password);
      QueryServiceStub queryServiceStub = new QueryServiceStub("https://pilotvipuserservices-
      auth.symantec.com/vipuserservices/QueryService_1_0");
      GetServerTimeRequest getServerTimeRequestBean = new GetServerTimeRequest();
      ....
     }
     ...
    }

     

    Is that a way to set the keystore infomations to configuration object instead modified system variables?  That is because I call the VIP API in a web app and this systsem variable setting (javax.net.ssl.keyStore...) also read by other app.

     

    Any help?  Thx

     

    Rgds

    SJ