+ psCredProps.print("cadi_keyfile=");
+ psCredProps.println(fkf.getCanonicalPath());
+
+ psCredProps.print(Config.AAF_APPID);
+ psCredProps.print('=');
+ psCredProps.println(fqi);
+
+ Symm filesymm = Symm.obtain(fkf);
+ psCredProps.print(Config.AAF_APPPASS);
+ psCredProps.print("=enc:");
+ String ps = pa.decrypt(pa.getProperty(Config.AAF_APPPASS), false);
+ ps = filesymm.enpass(ps);
+ psCredProps.println(ps);
+
+ psCredProps.print(Config.CADI_TRUSTSTORE);
+ psCredProps.print("=");
+ File origTruststore = new File(pa.getProperty(Config.CADI_TRUSTSTORE));
+ File newTruststore = new File(dir,origTruststore.getName());
+ if(!newTruststore.exists()) {
+ Files.copy(origTruststore.toPath(), newTruststore.toPath());
+ }
+ psCredProps.println(newTruststore.getCanonicalPath());
+
+ psCredProps.print(Config.CADI_TRUSTSTORE_PASSWORD);
+ psCredProps.print("=enc:");
+ ps = pa.decrypt(pa.getProperty(Config.CADI_TRUSTSTORE_PASSWORD), false);
+ ps = filesymm.enpass(ps);
+ psCredProps.println(ps);
+
+ try {
+ Future<Configuration> acf = aafcon.client(new SingleEndpointLocator(locator))
+ .read("/configure/"+fqi+"/aaf", configDF);
+ if(acf.get(TIMEOUT)) {
+ // out.println(acf.value.getName());
+ for(Props props : acf.value.getProps()) {
+ psProps.println(props.getTag() + '=' + props.getValue());
+ }
+ ok = true;
+ } else if(acf.code()==401){
+ trans.error().log("Bad Password sent to AAF");
+ } else {
+ trans.error().log(errMsg.toMsg(acf));
+ }
+ } finally {
+ psProps.close();
+ }
+ if(ok) {
+ File newFile = new File(dir,rootFile+".props");
+ fProps.renameTo(newFile);
+ System.out.println("Created " + newFile.getCanonicalPath());
+ fProps = newFile;
+
+ fSecureTempProps.renameTo(fSecureProps);
+ System.out.println("Created " + fSecureProps.getCanonicalPath());
+ fProps = newFile;
+ } else {
+ fProps.delete();
+ fSecureTempProps.delete();
+ }
+ } finally {
+ psCredProps.close();