1 17 package org.apache.servicemix.http; 18 19 26 public class SslParameters { 27 28 private boolean managed; 29 private String keyAlias; 30 private String keyPassword; 31 private String keyStore; 32 private String keyStorePassword; 33 private String keyStoreType = "JKS"; private String trustStore; 35 private String trustStorePassword; 36 private String trustStoreType = "JKS"; 37 private String protocol = "TLS"; 38 private String keyManagerFactoryAlgorithm = "SunX509"; private String trustManagerFactoryAlgorithm = "SunX509"; private String provider = null; 41 private boolean wantClientAuth = false; 42 private boolean needClientAuth = false; 43 44 47 public String getProvider() { 48 return provider; 49 } 50 53 public void setProvider(String provider) { 54 this.provider = provider; 55 } 56 59 public boolean isManaged() { 60 return managed; 61 } 62 65 public void setManaged(boolean managed) { 66 this.managed = managed; 67 } 68 71 public String getKeyAlias() { 72 return keyAlias; 73 } 74 77 public void setKeyAlias(String keyAlias) { 78 this.keyAlias = keyAlias; 79 } 80 83 public String getKeyManagerFactoryAlgorithm() { 84 return keyManagerFactoryAlgorithm; 85 } 86 89 public void setKeyManagerFactoryAlgorithm(String algorithm) { 90 this.keyManagerFactoryAlgorithm = algorithm; 91 } 92 95 public String getTrustManagerFactoryAlgorithm() { 96 return trustManagerFactoryAlgorithm; 97 } 98 101 public void setTrustManagerFactoryAlgorithm(String algorithm) { 102 this.trustManagerFactoryAlgorithm = algorithm; 103 } 104 107 public String getKeyPassword() { 108 return keyPassword; 109 } 110 113 public void setKeyPassword(String keyPassword) { 114 this.keyPassword = keyPassword; 115 } 116 119 public String getKeyStore() { 120 return keyStore; 121 } 122 125 public void setKeyStore(String keyStore) { 126 this.keyStore = keyStore; 127 } 128 131 public String getKeyStorePassword() { 132 return keyStorePassword; 133 } 134 137 public void setKeyStorePassword(String keyStorePassword) { 138 this.keyStorePassword = keyStorePassword; 139 } 140 143 public String getKeyStoreType() { 144 return keyStoreType; 145 } 146 149 public void setKeyStoreType(String keyStoreType) { 150 this.keyStoreType = keyStoreType; 151 } 152 155 public boolean isNeedClientAuth() { 156 return needClientAuth; 157 } 158 161 public void setNeedClientAuth(boolean needClientAuth) { 162 this.needClientAuth = needClientAuth; 163 } 164 167 public String getProtocol() { 168 return protocol; 169 } 170 173 public void setProtocol(String protocol) { 174 this.protocol = protocol; 175 } 176 179 public boolean isWantClientAuth() { 180 return wantClientAuth; 181 } 182 185 public void setWantClientAuth(boolean wantClientAuth) { 186 this.wantClientAuth = wantClientAuth; 187 } 188 191 public String getTrustStore() { 192 return trustStore; 193 } 194 197 public void setTrustStore(String trustStore) { 198 this.trustStore = trustStore; 199 } 200 203 public String getTrustStorePassword() { 204 return trustStorePassword; 205 } 206 209 public void setTrustStorePassword(String trustStorePassword) { 210 this.trustStorePassword = trustStorePassword; 211 } 212 215 public String getTrustStoreType() { 216 return trustStoreType; 217 } 218 221 public void setTrustStoreType(String trustStoreType) { 222 this.trustStoreType = trustStoreType; 223 } 224 225 public boolean equals(Object o) { 226 if (o == this) { 227 return true; 228 } 229 if (o instanceof SslParameters == false) { 230 return false; 231 } 232 SslParameters s = (SslParameters) o; 233 return managed == s.managed && 234 eq(keyAlias, s.keyAlias) && 235 eq(keyManagerFactoryAlgorithm, s.keyManagerFactoryAlgorithm) && 236 eq(trustManagerFactoryAlgorithm, s.trustManagerFactoryAlgorithm) && 237 eq(keyPassword, s.keyPassword) && 238 eq(keyStore, s.keyStore) && 239 eq(keyStorePassword, s.keyStorePassword) && 240 eq(keyStoreType, s.keyStoreType) && 241 needClientAuth == s.needClientAuth && 242 eq(protocol, s.protocol) && 243 eq(trustStore, s.trustStore) && 244 eq(trustStorePassword, s.trustStorePassword) && 245 eq(trustStoreType, s.trustStoreType) && 246 wantClientAuth == s.wantClientAuth; 247 248 } 249 250 public int hashCode() { 251 return Boolean.valueOf(managed).hashCode() ^ 252 hash(keyAlias) ^ 253 hash(keyManagerFactoryAlgorithm) ^ 254 hash(trustManagerFactoryAlgorithm) ^ 255 hash(keyPassword) ^ 256 hash(keyStore) ^ 257 hash(keyStorePassword) ^ 258 hash(keyStoreType) ^ 259 Boolean.valueOf(needClientAuth).hashCode() ^ 260 hash(protocol) ^ 261 hash(trustStore) ^ 262 hash(trustStorePassword) ^ 263 hash(trustStoreType) ^ 264 Boolean.valueOf(wantClientAuth).hashCode(); 265 } 266 267 private static boolean eq(String s1, String s2) { 268 return (s1 == null) ? s2 == null : s1.equals(s2); 269 } 270 271 private static int hash(String s) { 272 return s != null ? s.hashCode() : 0; 273 } 274 275 276 } 277 | Popular Tags |