Fields Summary |
---|
public static final SSLSessionImpl | NULL_SESSIONSession object reporting an invalid cipher suite of
"SSL_NULL_WITH_NULL_NULL" |
private long | creationTime |
private boolean | isValid |
private org.apache.harmony.luni.util.TwoKeyHashMap | values |
byte[] | idID of the session |
long | lastAccessedTimeLast time the session was accessed |
ProtocolVersion | protocolProtocol used in the session |
CipherSuite | cipherSuiteCipherSuite used in the session |
SSLSessionContext | contextContext of the session |
X509Certificate[] | localCertificatescertificates were sent to the peer |
X509Certificate[] | peerCertificatesPeer certificates |
String | peerHostPeer host name |
int | peerPortPeer port number |
byte[] | master_secretMaster secret |
byte[] | clientRandomclientRandom |
byte[] | serverRandomserverRandom |
boolean | isServerTrue if this entity is considered the server |
Methods Summary |
---|
public java.lang.Object | clone()
SSLSessionImpl ses = new SSLSessionImpl();
ses.id = this.id;
ses.creationTime = this.creationTime;
ses.lastAccessedTime = this.lastAccessedTime;
ses.isValid = this.isValid;
ses.cipherSuite = this.cipherSuite;
ses.localCertificates = this.localCertificates;
ses.peerCertificates = this.peerCertificates;
ses.master_secret = this.master_secret;
ses.clientRandom = this.clientRandom;
ses.serverRandom = this.serverRandom;
ses.peerHost = this.peerHost;
ses.peerPort = this.peerPort;
ses.isServer = this.isServer;
ses.context = this.context;
ses.protocol = this.protocol;
ses.values = this.values;
return ses;
|
public int | getApplicationBufferSize()
return SSLRecordProtocol.MAX_DATA_LENGTH;
|
public java.lang.String | getCipherSuite()
return cipherSuite.getName();
|
public long | getCreationTime()
return creationTime;
|
public byte[] | getId()
return id;
|
public long | getLastAccessedTime()
return lastAccessedTime;
|
public java.security.cert.Certificate[] | getLocalCertificates()
return localCertificates;
|
public java.security.Principal | getLocalPrincipal()
if (localCertificates != null && localCertificates.length > 0) {
return localCertificates[0].getSubjectX500Principal();
} else {
return null;
}
|
public int | getPacketBufferSize()
return SSLRecordProtocol.MAX_SSL_PACKET_SIZE;
|
public javax.security.cert.X509Certificate[] | getPeerCertificateChain()
if (peerCertificates == null) {
throw new SSLPeerUnverifiedException("No peer certificate");
}
javax.security.cert.X509Certificate[] certs = new javax.security.cert.X509Certificate[peerCertificates.length];
for (int i = 0; i < certs.length; i++) {
try {
certs[i] = javax.security.cert.X509Certificate
.getInstance(peerCertificates[i].getEncoded());
} catch (javax.security.cert.CertificateException e) {
} catch (CertificateEncodingException e) {
}
}
return certs;
|
public java.security.cert.Certificate[] | getPeerCertificates()
if (peerCertificates == null) {
throw new SSLPeerUnverifiedException("No peer certificate");
}
return peerCertificates;
|
public java.lang.String | getPeerHost()
return peerHost;
|
public int | getPeerPort()
return peerPort;
|
public java.security.Principal | getPeerPrincipal()
if (peerCertificates == null) {
throw new SSLPeerUnverifiedException("No peer certificate");
}
return peerCertificates[0].getSubjectX500Principal();
|
public java.lang.String | getProtocol()
return protocol.name;
|
public javax.net.ssl.SSLSessionContext | getSessionContext()
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new SSLPermission("getSSLSessionContext"));
}
return context;
|
public java.lang.Object | getValue(java.lang.String name)
if (name == null) {
throw new IllegalArgumentException("Parameter is null");
}
return values.get(name, AccessController.getContext());
|
public java.lang.String[] | getValueNames()
Vector v = new Vector();
AccessControlContext current = AccessController.getContext();
AccessControlContext cont;
for (Iterator it = values.entrySet().iterator(); it.hasNext();) {
TwoKeyHashMap.Entry entry = (TwoKeyHashMap.Entry) it.next();
cont = (AccessControlContext) entry.getKey2();
if ((current == null && cont == null)
|| (current != null && current.equals(cont))) {
v.add(entry.getKey1());
}
}
return (String[]) v.toArray(new String[0]);
|
public void | invalidate()
isValid = false;
|
public boolean | isValid()
if (isValid
&& context != null
&& context.getSessionTimeout() != 0
&& lastAccessedTime + context.getSessionTimeout() > System
.currentTimeMillis()) {
isValid = false;
}
return isValid;
|
public void | putValue(java.lang.String name, java.lang.Object value)
if (name == null || value == null) {
throw new IllegalArgumentException("Parameter is null");
}
Object old = values.put(name, AccessController.getContext(), value);
if (value instanceof SSLSessionBindingListener) {
((SSLSessionBindingListener) value)
.valueBound(new SSLSessionBindingEvent(this, name));
}
if (old != null && old instanceof SSLSessionBindingListener) {
((SSLSessionBindingListener) old)
.valueUnbound(new SSLSessionBindingEvent(this, name));
}
|
public void | removeValue(java.lang.String name)
if (name == null) {
throw new IllegalArgumentException("Parameter is null");
}
values.remove(name, AccessController.getContext());
|
void | setPeer(java.lang.String peerHost, int peerPort)Sets the address of the peer
this.peerHost = peerHost;
this.peerPort = peerPort;
|