1 14 15 package org.quickserver.util.xmlreader; 16 17 44 public class SecureStore implements java.io.Serializable { 45 private String type = "JKS"; 46 private String algorithm = "SunX509"; 47 private String provider = null; private KeyStoreInfo keyStoreInfo = null; 49 private TrustStoreInfo trustStoreInfo = null; 50 private String secureStoreManager = "org.quickserver.security.SecureStoreManager"; 51 52 59 public void setType(String type) { 60 if(type!=null && type.trim().length()!=0) 61 this.type = type; 62 } 63 67 public String getType() { 68 return type; 69 } 70 71 79 public void setAlgorithm(String algorithm) { 80 if(algorithm!=null && algorithm.trim().length()!=0) 81 this.algorithm = algorithm; 82 } 83 88 public String getAlgorithm() { 89 return algorithm; 90 } 91 92 99 public void setProvider(String provider) { 100 if(provider!=null && provider.trim().length()!=0) 101 this.provider = provider; 102 } 103 107 public String getProvider() { 108 return provider; 109 } 110 111 117 public void setKeyStoreInfo(KeyStoreInfo keyStoreInfo) { 118 if(keyStoreInfo!=null) 119 this.keyStoreInfo = keyStoreInfo; 120 } 121 125 public KeyStoreInfo getKeyStoreInfo() { 126 return keyStoreInfo; 127 } 128 129 135 public void setTrustStoreInfo(TrustStoreInfo trustStoreInfo) { 136 if(trustStoreInfo!=null) 137 this.trustStoreInfo = trustStoreInfo; 138 } 139 143 public TrustStoreInfo getTrustStoreInfo() { 144 return trustStoreInfo; 145 } 146 147 148 158 public void setSecureStoreManager(String className) { 159 if(className!=null && className.trim().length()!=0) 160 this.secureStoreManager = className; 161 } 162 168 public String getSecureStoreManager() { 169 return secureStoreManager; 170 } 171 172 175 public String toXML(String pad) { 176 if(pad==null) pad=""; 177 StringBuffer sb = new StringBuffer (); 178 sb.append(pad).append("<secure-store>\n"); 179 sb.append(pad).append("\t<type>").append(getType()).append("</type>\n"); 180 sb.append(pad).append("\t<algorithm>").append(getAlgorithm()).append("</algorithm>\n"); 181 if(getProvider()!=null) 182 sb.append(pad).append("\t<provider>").append(getProvider()).append("</provider>\n"); 183 if(getKeyStoreInfo()!=null) { 184 sb.append(getKeyStoreInfo().toXML(pad+"\t")); 185 } 186 if(getTrustStoreInfo()!=null) { 187 sb.append(getTrustStoreInfo().toXML(pad+"\t")); 188 } 189 sb.append(pad).append("\t<secure-store-manager>").append(getSecureStoreManager()).append("</secure-store-manager>\n"); 190 sb.append(pad+"</secure-store>\n"); 191 return sb.toString(); 192 } 193 } 194 | Popular Tags |