Methods Summary |
---|
public java.lang.String | chooseClientAlias(java.lang.String[] as, java.security.Principal[] aprincipal, java.net.Socket socket)
String alias = null;
if (as == null || as.length == 0) {
return null;
}
try {
if (as.length == 1 && as[0].equals(client)) {
if (socket == null) {
alias = keyTest.getCertificateAlias(cert[0]);
} else {
alias = keyTest.getCertificateAlias(cert[1]);
}
return alias;
}
} catch (Exception ex) {
throw new IllegalArgumentException(ex.getMessage());
}
return null;
|
public java.lang.String | chooseServerAlias(java.lang.String as, java.security.Principal[] aprincipal, java.net.Socket socket)
String alias = null;
if (as == null || as.equals("")) {
return null;
}
try {
if (as.equals(server) && socket != null) {
return alias = keyTest.getCertificateAlias(cert[0]);
} else return null;
} catch (Exception ex) {
throw new IllegalArgumentException(ex.getMessage());
}
|
public java.security.cert.X509Certificate[] | getCertificateChain(java.lang.String s)
/*try {
if (s != null && !s.equals("")) {
X509Certificate[] cert = (X509Certificate[]) keyTest.getCertificateChain(s);
return cert;
} else return null;
} catch (Exception ex) {
throw new IllegalArgumentException(ex.getMessage());
}*/
return null;
|
public java.lang.String[] | getClientAliases(java.lang.String s, java.security.Principal[] aprincipal)
if (s == null || s.equals("")) {
return null;
}
try {
if (s.equals(client)) {
Enumeration<String> aliase = keyTest.aliases();
Vector vec = new Vector();
int i = 0;
while (aliase.hasMoreElements()) {
vec.addElement(aliase.nextElement());
i++;
}
String[] res = new String[vec.size()];
for (i = 0; i < vec.size(); i++) {
res[i] = vec.elementAt(i).toString();
}
return res;
} else return null;
} catch (Exception ex) {
throw new IllegalArgumentException(ex.getMessage());
}
|
public java.security.PrivateKey | getPrivateKey(java.lang.String s)
/*try {
if (s != null && !s.equals("")) {
Certificate[] cert = keyTest.getCertificateChain(s);
PrivateKey pk = (PrivateKey) keyTest.getKey(s, null);
return pk;
} else return null;
} catch (Exception ex) {
throw new IllegalArgumentException(ex.getMessage());
}*/
return null;
|
public java.lang.String[] | getServerAliases(java.lang.String s, java.security.Principal[] aprincipal)
if (s == null || s.equals("")) {
return null;
}
try {
if (s.equals(server)) {
Enumeration<String> aliase = keyTest.aliases();
Vector vec = new Vector();
int i = 0;
while (aliase.hasMoreElements()) {
vec.addElement(aliase.nextElement());
i++;
}
String[] res = new String[vec.size()];
for (i = 0; i < vec.size(); i++) {
res[i] = vec.elementAt(i).toString();
}
return res;
} else return null;
} catch (Exception ex) {
throw new IllegalArgumentException(ex.getMessage());
}
|