* Copied from <code>org.apache.catalina.valves.CertificateValve</code>
*/
public Integer getKeySize()
throws IOException {
// Look up the current SSLSession
SSLSession session = ssl.getSession();
if (session == null)
return null;
Integer keySize = (Integer) session.getValue(KEY_SIZE_KEY);
if (keySize == null) {
int size = 0;
String cipherSuite = session.getCipherSuite();
for (int i = 0; i < ciphers.length; i++) {
if (cipherSuite.indexOf(ciphers[i].phrase) >= 0) {
size = ciphers[i].keySize;
break;
}
}
keySize = new Integer(size);
session.putValue(KEY_SIZE_KEY, keySize);
}
return keySize;
}