TrustagentConfiguration { public String[] getTrustagentTlsCertIpArray() throws SocketException { String[] TlsCertIPs = conf.get(TRUSTAGENT_TLS_CERT_IP, "").split(","); if (TlsCertIPs != null && !TlsCertIPs[0].isEmpty()) { log.debug("Retrieved IPs from trust agent configuration: {}", (Object[])TlsCertIPs); return TlsCertIPs; } List<String> TlsCertIPsList = NetUtils.getNetworkAddressList(); String[] ipListArray = new String[TlsCertIPsList.size()]; if (ipListArray.length > 0) { log.debug("Retrieved IPs from network configuration: {}", (Object[])ipListArray); return TlsCertIPsList.toArray(ipListArray); } log.debug("Returning default IP address [127.0.0.1]"); return new String[]{"127.0.0.1"}; } TrustagentConfiguration(org.apache.commons.configuration.Configuration configuration);  TrustagentConfiguration(Configuration configuration); Configuration getConf(); List<String> getMtWilsonTlsCertificateFingerprints(); String getMtWilsonApiUrl(); String getMtWilsonApiUsername(); String getMtWilsonApiPassword(); String getTpmOwnerSecretHex(); String getJettyThreadMin(); String getJettyThreadMax(); byte[] getTpmOwnerSecret(); String getTpmSrkSecretHex(); byte[] getTpmSrkSecret(); String getAikSecretHex(); byte[] getAikSecret(); int getAikIndex(); String getAikHandleHex(); String getAikHandle(); void setAikHandle(String khandle); String getEkHandleHex(); String getEkHandle(); void setEkHandle(String khandle); String getAikName(); void setAikName(String kname); File getAikCertificateFile(); File getAikBlobFile(); File getAikOpaqueFile(); int getTrustagentHttpTlsPort(); String getTrustagentTlsCertDn(); String getTrustagentTlsCertIp(); String[] getTrustagentTlsCertIpArray(); String getTrustagentTlsCertDns(); String[] getTrustagentTlsCertDnsArray(); File getTrustagentKeystoreFile(); String getTrustagentKeystorePassword(); File getEndorsementAuthoritiesFile(); File getTrustagentUserFile(); File getTrustagentPermissionsFile(); File getTrustagentEtagCacheFile(); boolean isDaaEnabled(); boolean isTpmQuoteWithIpAddress(); String getHardwareUuid(); File getMeasureLogLaunchScript(); File getTcbMeasurementXmlFile(); String getMtwilsonTlsPolicyCertificateSha256(); Properties getMtWilsonClientProperties(); static TrustagentConfiguration loadConfiguration(); String getBindingKeySecretHex(); byte[] getBindingKeySecret(); int getBindingKeyIndex(); File getBindingKeyModulusFile(); File getBindingKeyTCGCertificateFile(); File getBindingKeyTCGCertificateSignatureFile(); File getBindingKeyX509CertificateFile(); File getBindingKeyBlobFile(); String getSigningKeySecretHex(); byte[] getSigningKeySecret(); int getSigningKeyIndex(); File getSigningKeyModulusFile(); File getSigningKeyTCGCertificateFile(); File getSigningKeyTCGCertificateSignatureFile(); File getSigningKeyX509CertificateFile(); File getSigningKeyBlobFile(); String getTrustAgentAdminUserName(); static String getTpmVersion(); File getEcCertificateFile(); File getEkHandleFile(); File getAkHandleFile(); File getAkNameFile(); static String readFromFile(String inFileName); static void writeToFile(String outFilename, String outBytes); final static String MTWILSON_API_URL; final static String MTWILSON_TLS_CERT_SHA256; final static String MTWILSON_API_USERNAME; final static String MTWILSON_API_PASSWORD; final static String TPM_OWNER_SECRET; final static String TPM_SRK_SECRET; final static String AIK_SECRET; final static String AIK_INDEX; final static String AIK_HANDLE; final static String EK_HANDLE; final static String TRUSTAGENT_HTTP_TLS_PORT; final static String TRUSTAGENT_TLS_CERT_DN; final static String TRUSTAGENT_TLS_CERT_IP; final static String TRUSTAGENT_TLS_CERT_DNS; final static String TRUSTAGENT_KEYSTORE_PASSWORD; final static String DAA_ENABLED; final static String TPM_QUOTE_IPV4; static final String HARDWARE_UUID; static final String BINDING_KEY_NAME; static final String BINDING_KEY_SECRET; static final String BINDING_KEY_INDEX; static final String SIGNING_KEY_NAME; static final String SIGNING_KEY_SECRET; static final String SIGNING_KEY_INDEX; static final String TRUSTAGENT_ADMIN_USERNAME; final static String JETTY_THREAD_MIN; final static String JETTY_THREAD_MAX; }
@Test public void testGetTrustagentTlsCertIpArray() throws SocketException { PropertiesConfiguration p = new PropertiesConfiguration(); TrustagentConfiguration c = new TrustagentConfiguration(p); long start = System.currentTimeMillis(); log.debug("ips={}",(Object[])c.getTrustagentTlsCertIpArray()); long end = System.currentTimeMillis(); log.debug("time={}ms",(end-start)); }