diff options
Diffstat (limited to 'javax/net/ssl/HandshakeCompletedEvent.java')
-rw-r--r-- | javax/net/ssl/HandshakeCompletedEvent.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/javax/net/ssl/HandshakeCompletedEvent.java b/javax/net/ssl/HandshakeCompletedEvent.java index 743f13726..b65dff06c 100644 --- a/javax/net/ssl/HandshakeCompletedEvent.java +++ b/javax/net/ssl/HandshakeCompletedEvent.java @@ -38,6 +38,7 @@ exception statement from your version. */ package javax.net.ssl; +import java.security.Principal; import java.security.cert.Certificate; import javax.security.cert.X509Certificate; @@ -108,6 +109,20 @@ public class HandshakeCompletedEvent extends java.util.EventObject } /** + * Returns the local identity used in this connection, or + * <code>null</code> if there is none. + * + * @return The local identity. + * @since 1.5 + */ + public Principal getLocalPrincipal () + { + if (session != null) + return session.getLocalPrincipal (); + return null; + } + + /** * Returns the peer's certificates being used in this connection. * * @return The peer's certificates. @@ -129,6 +144,22 @@ public class HandshakeCompletedEvent extends java.util.EventObject } /** + * Returns the peer's identity, or <code>null</code> if there is + * none. + * + * @return The peer's identity. + * @throws SSLPeerUnverifiedException If the remote peer's identity + * could not be verified. + * @since 1.5 + */ + public Principal getPeerPrincipal () throws SSLPeerUnverifiedException + { + if (session != null) + return session.getPeerPrincipal (); + return null; + } + + /** * Returns the SSL session object associated with this connection. * * @return The session object. |